diff options
author | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-11 19:36:11 +0000 |
---|---|---|
committer | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-11 19:36:11 +0000 |
commit | 47394901038be62d1c44f9924cc5fb8733fb7799 (patch) | |
tree | 7acd17995f62eea25441ab1c9dd29e04033cc7fb /o3d | |
parent | b22ef28f215f7475f1c0401f89e353a8aacf8def (diff) | |
download | chromium_src-47394901038be62d1c44f9924cc5fb8733fb7799.zip chromium_src-47394901038be62d1c44f9924cc5fb8733fb7799.tar.gz chromium_src-47394901038be62d1c44f9924cc5fb8733fb7799.tar.bz2 |
New code needs some NULL checks so we don't crash FireFox on 10.6.
Review URL: http://codereview.chromium.org/492016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/plugin/mac/plugin_mac.mm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/o3d/plugin/mac/plugin_mac.mm b/o3d/plugin/mac/plugin_mac.mm index 74354a1..517f4a5 100644 --- a/o3d/plugin/mac/plugin_mac.mm +++ b/o3d/plugin/mac/plugin_mac.mm @@ -113,11 +113,15 @@ bool GetBrowserVersionInfo(int *returned_major, void ReleaseSafariBrowserWindow(void* browserWindow) { - NSWindow* cocoaWindow = (NSWindow*) browserWindow; - // Retain the WindowRef so it doesn't go away when we release the - // NSWindow copy we made. - CFRetain([cocoaWindow windowRef]); - [cocoaWindow release]; + if (browserWindow) { + NSWindow* cocoaWindow = (NSWindow*) browserWindow; + // Retain the WindowRef so it doesn't go away when we release the + // NSWindow copy we made. + WindowRef theWindow = (WindowRef)[cocoaWindow windowRef]; + if (theWindow) + CFRetain(theWindow); + [cocoaWindow release]; + } } void* SafariBrowserWindowForWindowRef(WindowRef theWindow) { |