Re: [AD] SF.net SVN: alleg:[11691] allegro/branches/4.9/addons/native_dialog

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 23 feb 2009, at 22:35, Peter Wang wrote:
+      const char *s = [[fd->files objectAtIndex:i] UTF8String];
+      return al_path_create(strdup(s));
+   }

This looks like two memory leaks:

- al_path_create() copies its argument so strdup() creates a leak.

I think I blindly copied that from an earlier version of the gtk plugin. It does look redundant anyway - it would be a nasty side- effect if al_path_create() behaved differently.

- The caller of al_get_native_file_dialog_path() isn't expected to
 call al_path_free() on the return value.

Right.

I'll fix both of these, probably tomorrow.

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/