diff --git a/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp b/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp index 5286cf6e8f5..912c8e718dc 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedContentListener.cpp @@ -36,8 +36,9 @@ EmbedContentListener::~EmbedContentListener() { } -NS_IMPL_ISUPPORTS1(EmbedContentListener, - nsIURIContentListener) +NS_IMPL_ISUPPORTS2(EmbedContentListener, + nsIURIContentListener, + nsISupportsWeakReference) nsresult EmbedContentListener::Init(EmbedPrivate *aOwner) diff --git a/mozilla/embedding/browser/gtk/src/EmbedContentListener.h b/mozilla/embedding/browser/gtk/src/EmbedContentListener.h index c5cf1911ef8..dfe81a55ed5 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedContentListener.h +++ b/mozilla/embedding/browser/gtk/src/EmbedContentListener.h @@ -23,10 +23,12 @@ #define __EmbedContentListener_h #include +#include class EmbedPrivate; -class EmbedContentListener : public nsIURIContentListener +class EmbedContentListener : public nsIURIContentListener, + public nsSupportsWeakReference { public: diff --git a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp index d1761869334..b660aa6a55a 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp @@ -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