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
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] SF.net SVN: alleg:[11691] allegro/branches/4.9/addons/native_dialog
- From: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Mon, 23 Feb 2009 23:12:20 -0800
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