RESOLVED FIXED 46220
Fix some Objective-C GC problems and use RetainPtr instead of HardRetain/Release
https://bugs.webkit.org/show_bug.cgi?id=46220
Summary Fix some Objective-C GC problems and use RetainPtr instead of HardRetain/Release
Darin Adler
Reported 2010-09-21 14:56:45 PDT
Fix some Objective-C GC problems and use RetainPtr instead of HardRetain/Release
Attachments
Patch (39.22 KB, patch)
2010-09-21 16:00 PDT, Darin Adler
no flags
Patch (39.21 KB, patch)
2010-09-21 17:04 PDT, Darin Adler
andersca: review+
Darin Adler
Comment 1 2010-09-21 16:00:05 PDT
Early Warning System Bot
Comment 2 2010-09-21 16:10:49 PDT
WebKit Review Bot
Comment 3 2010-09-21 16:27:09 PDT
WebKit Review Bot
Comment 4 2010-09-21 17:02:10 PDT
Darin Adler
Comment 5 2010-09-21 17:04:58 PDT
Anders Carlsson
Comment 6 2010-09-22 09:43:39 PDT
Comment on attachment 68312 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=68312&action=review > WebCore/bindings/objc/ObjCEventListener.h:59 > + typedef id <DOMEventListener> ObjCListener; There shouldn't be a space after id here. > WebCore/bridge/objc/objc_instance.mm:88 > + s_exception = nil; How will not retaining here work in a non-GC environment?
Darin Adler
Comment 7 2010-09-22 09:48:44 PDT
(In reply to comment #6) > > WebCore/bridge/objc/objc_instance.mm:88 > > + s_exception = nil; > > How will not retaining here work in a non-GC environment? This is a global in an Objective-C++ source file; the compiler and garbage collection runtime already handles this correctly without explicit retain/release. We have many other globals like this. An earlier version of my patch attempted to “fix” all those, but then I talked to Tim Hatcher, read some documentation, and did a little testing, and saw this worked fine. In fact, the problem in ThemeMac.mm quite possibly is Leopard-only because it seems that the SnowLeopard version of GC can handle modifying an Objective-C global through a pointer even though the Leopard version cannot. But the fix is OK for all platforms.
Darin Adler
Comment 8 2010-09-22 09:50:52 PDT
(In reply to comment #6) > > WebCore/bindings/objc/ObjCEventListener.h:59 > > + typedef id <DOMEventListener> ObjCListener; > > There shouldn't be a space after id here. I did a quick grep and I see that we have id without a space in 6 places in WebCore and id with a space in about 50 places, including public headers. I think we should standardize on one or the other, but for this patch I will leave this site alone -- it matches what used to be there.
Darin Adler
Comment 9 2010-09-22 09:55:51 PDT
(In reply to comment #7) > (In reply to comment #6) > > > WebCore/bridge/objc/objc_instance.mm:88 > > > + s_exception = nil; > > > > How will not retaining here work in a non-GC environment? > > This is a global in an Objective-C++ source file; the compiler and garbage collection runtime already handles this correctly without explicit retain/release. We have many other globals like this. An earlier version of my patch attempted to “fix” all those, but then I talked to Tim Hatcher, read some documentation, and did a little testing, and saw this worked fine. > > In fact, the problem in ThemeMac.mm quite possibly is Leopard-only because it seems that the SnowLeopard version of GC can handle modifying an Objective-C global through a pointer even though the Leopard version cannot. But the fix is OK for all platforms. Oops! You said “non-GC”! That change was bad. I have to retain/release. Fixed now.
Darin Adler
Comment 10 2010-09-22 10:26:33 PDT
Note You need to log in before you can comment on or make changes to this bug.