From 2e2f297290a0930094f38998b17dd9e1d2e33b24 Mon Sep 17 00:00:00 2001 From: "erik%netscape.com" Date: Sun, 13 Feb 2000 18:05:36 +0000 Subject: [PATCH] bug 27543 and bug 27566; crashing in profile manager; need to unregister pref callback when destroying device context; r=none --- gfx/src/windows/nsDeviceContextWin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/src/windows/nsDeviceContextWin.cpp b/gfx/src/windows/nsDeviceContextWin.cpp index d7529595c98..7070eb595a1 100644 --- a/gfx/src/windows/nsDeviceContextWin.cpp +++ b/gfx/src/windows/nsDeviceContextWin.cpp @@ -82,6 +82,12 @@ nsDeviceContextWin :: ~nsDeviceContextWin() } NS_IF_RELEASE(mSpec); + + nsresult res = NS_ERROR_FAILURE; + NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &res); + if (NS_SUCCEEDED(res)) { + prefs->UnregisterCallback(nav4rounding, PrefChanged, this); + } } NS_IMETHODIMP nsDeviceContextWin :: Init(nsNativeWidget aWidget)