[PATCH] winemac: Remove a window from the NSWorkspace notification center when it's deallocated.

Ken Thomases ken at codeweavers.com
Mon Nov 30 14:34:59 CST 2015


It was added as an observer in commit 3beec95a0.  Failing to remove it caused
the notification center to have a dangling pointer and caused crashes and hangs.

Fixes <https://bugs.winehq.org/show_bug.cgi?id=39705>.

Signed-off-by: Ken Thomases <ken at codeweavers.com>
---
 dlls/winemac.drv/cocoa_window.m | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 75f5605..bcc1cf5 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -777,6 +777,7 @@ + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)w
 
     - (void) dealloc
     {
+        [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self];
         [[NSNotificationCenter defaultCenter] removeObserver:self];
         [queue release];
         [latentChildWindows release];
-- 
2.6.0




More information about the wine-patches mailing list