Re: [gtk-osx-devel] [PATCH] gtk-mac-integration reference counting
- From: John Ralls <jralls ceridwen us>
- To: Richard Procter <richard n procter gmail com>
- Cc: gtk-osx-devel-list gnome org
- Subject: Re: [gtk-osx-devel] [PATCH] gtk-mac-integration reference counting
- Date: Sat, 28 Jan 2012 21:01:51 -0800
On Jan 28, 2012, at 2:09 PM, Richard Procter wrote:
> Hi John,
>
> I ran the latest clang static analyzer [1] over gtk-mac-integration - here's a patch for a couple of ref-counting issues it found. Nothing that looks crucial but nice to have all the same. I've compiled it but have not tested it and as I rarely use objective-c it's worth casting your eye over it.
>
> My understanding is that class methods return an autoreleased object, so, e.g. [NSString stringWithUTF8String:] doesn't require an explicit release [2].
>
> I've also renamed gtk_mac_image_from_pixbuf() -> gtk_create_cgimage_from_pixbuf() to indicate the returned CGImage is owned by the caller. This function isn't exposed in the bindings.
>
> Lastly, their scan-build tool is very useful but doesn't quite run out-of-the-box with gtk-mac-integration as I couldn't find a way to force it to parse objective-c, except for renaming the source files .objectivec, which automake then choked on. So I just ran:
>
> $ for x in *.c; do ./checker-260/bin/clang --analyze -x objective-c [whole bunch of includes] $x; done
>
> ... manually, and did without the pretty HTML reporting.
Richard,
Cool, thanks, I'll have a look at it -- But:
What SDK are you analyzing against? Apple has some new memory-management features in 10.7, and they did some major cleanup for 10.6. All well and good, but gtk-mac-integration has to work correctly with 10.4.
Functions need to keep the gtk_mac name (in fact, 1.1 will rename them to gtkmac_) for compatibility with
gobject-introspection.
checker-260/bin/clang? You're not using Apple's?
Regards,
John Ralls
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]