mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
support weak references in TestGtkEmbed's content listener (bug 191548). r=pavlov, sr=blizzard, a=asa.
This commit is contained in:
parent
124aa40bf5
commit
5a26c66ccf
@ -36,8 +36,9 @@ EmbedContentListener::~EmbedContentListener()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(EmbedContentListener,
|
||||
nsIURIContentListener)
|
||||
NS_IMPL_ISUPPORTS2(EmbedContentListener,
|
||||
nsIURIContentListener,
|
||||
nsISupportsWeakReference)
|
||||
|
||||
nsresult
|
||||
EmbedContentListener::Init(EmbedPrivate *aOwner)
|
||||
|
@ -23,10 +23,12 @@
|
||||
#define __EmbedContentListener_h
|
||||
|
||||
#include <nsIURIContentListener.h>
|
||||
#include <nsWeakReference.h>
|
||||
|
||||
class EmbedPrivate;
|
||||
|
||||
class EmbedContentListener : public nsIURIContentListener
|
||||
class EmbedContentListener : public nsIURIContentListener,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -136,7 +136,7 @@ EmbedPrivate::Init(GtkMozEmbed *aOwningWidget)
|
||||
// It is assumed that this will be destroyed when we go out of
|
||||
// scope.
|
||||
mContentListener = new EmbedContentListener();
|
||||
mContentListenerGuard = mContentListener;
|
||||
mContentListenerGuard = NS_STATIC_CAST(nsISupports*, NS_STATIC_CAST(nsIURIContentListener*, mContentListener));
|
||||
mContentListener->Init(this);
|
||||
|
||||
// Create our key listener object and initialize it. It is assumed
|
||||
|
Loading…
Reference in New Issue
Block a user