comparison pidgin/gtksound.c @ 23480:2ccad3a8d9fe

fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Fri, 18 Jul 2008 09:03:40 +0000
parents c32dd71d0658
children 9525fb966efb
comparison
equal deleted inserted replaced
23479:edb03a8d54bd 23480:2ccad3a8d9fe
578 578
579 579
580 /* check NULL for sounds that don't have an option, ie buddy pounce */ 580 /* check NULL for sounds that don't have an option, ie buddy pounce */
581 if (purple_prefs_get_bool(enable_pref)) { 581 if (purple_prefs_get_bool(enable_pref)) {
582 char *filename = g_strdup(purple_prefs_get_path(file_pref)); 582 char *filename = g_strdup(purple_prefs_get_path(file_pref));
583 theme_name = g_strdup(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme")); 583 theme_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme");
584 584
585 if (theme_name && strlen(theme_name) && (!filename || !strlen(filename))){ /* Use theme */ 585 if (theme_name && strlen(theme_name) && (!filename || !strlen(filename))){ /* Use theme */
586 g_free(filename); 586 g_free(filename);
587 587
588 theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(theme_name, "sound")); 588 theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(theme_name, "sound"));
602 filename = g_build_filename(DATADIR, "sounds", "purple", sounds[event].def, NULL); 602 filename = g_build_filename(DATADIR, "sounds", "purple", sounds[event].def, NULL);
603 } 603 }
604 604
605 purple_sound_play_file(filename, NULL); 605 purple_sound_play_file(filename, NULL);
606 606
607 g_free(theme_name);
608 g_free(filename); 607 g_free(filename);
609 } 608 }
610 609
611 610
612 g_free(enable_pref); 611 g_free(enable_pref);