From d6a7e127778eb5a21598d5a0540f431b707469be Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Thu, 17 Feb 2000 23:38:23 +0000 Subject: [PATCH] fix for #28275, r=erik, a=chofmann,phil properly unregister for pref callbacks --- gfx/src/gtk/nsDeviceContextGTK.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gfx/src/gtk/nsDeviceContextGTK.cpp b/gfx/src/gtk/nsDeviceContextGTK.cpp index 52d9be2dfd82..b65a8d669247 100644 --- a/gfx/src/gtk/nsDeviceContextGTK.cpp +++ b/gfx/src/gtk/nsDeviceContextGTK.cpp @@ -42,6 +42,9 @@ #define GDK_COLOR_TO_NS_RGB(c) \ ((nscolor) NS_RGB(c.red, c.green, c.blue)) +static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); + + nscoord nsDeviceContextGTK::mDpi = 96; NS_IMPL_ISUPPORTS1(nsDeviceContextGTK, nsIDeviceContext) @@ -66,9 +69,14 @@ nsDeviceContextGTK::nsDeviceContextGTK() nsDeviceContextGTK::~nsDeviceContextGTK() { + nsresult rv; + nsCOMPtr prefs = do_GetService(kPrefCID, &rv); + if (NS_SUCCEEDED(rv)) { + prefs->UnregisterCallback("browser.screen_resolution", + prefChanged, (void *)this); + } } -static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); NS_IMETHODIMP nsDeviceContextGTK::Init(nsNativeWidget aNativeWidget) {