diff options
author | jstebbins <[email protected]> | 2009-06-25 00:05:07 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-25 00:05:07 +0000 |
commit | 1f5936650ac23cec965a8934b36a21b4f4bcfa16 (patch) | |
tree | 4c98e89865fff84fdfd310e7b397177f18be0f88 /gtk | |
parent | 8721f201b405b383ce7cdbc27b0352ed6bb9b60e (diff) |
LinGui: fix more mingw breakage
freeing a drive entity returned from a windows api by unreferencing it
with a glib api doesn't work so well. abstract the call to free a drive
and ifdef it.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2617 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/callbacks.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index b0ef9b592..8fd2b7a94 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -446,6 +446,16 @@ ghb_volname_cache_init(void) free_volname_key, free_volname_value); } +static void +free_drive(gpointer drive) +{ +#if defined(_WIN32) + g_free(drive); +#else + g_object_unref(drive); +#endif +} + gpointer ghb_cache_volnames(signal_user_data_t *ud) { @@ -485,11 +495,7 @@ ghb_cache_volnames(signal_user_data_t *ud) g_free(name); } -#if defined(_WIN32) - g_free(link->data); -#else - g_object_unref(link->data); -#endif + free_drive(link->data); link = link->next; } g_mutex_unlock(volname_mutex); @@ -801,7 +807,7 @@ source_dialog_extra_widgets( gchar *name = get_dvd_device_name(link->data); gtk_combo_box_append_text(combo, name); g_free(name); - g_object_unref(link->data); + free_drive(link->data); link = link->next; } g_list_free(drives); @@ -3032,11 +3038,7 @@ ghb_file_menu_add_dvd(signal_user_data_t *ud) (GCallback)dvd_source_activate_cb, ud); g_free(name); g_free(drive); -#if defined(_WIN32) - g_free(link->data); -#else - g_object_unref(link->data); -#endif + free_drive(link->data); link = link->next; } g_list_free(drives); |