Skip to content
This repository has been archived by the owner on Mar 10, 2019. It is now read-only.

Commit

Permalink
fix some memory leaks. patch partially by John Daiker.
Browse files Browse the repository at this point in the history
2007-11-25  James Livingston  <[email protected]>

	* bindings/python/rb.defs:
	* metadata/rb-metadata-dbus-service.c: (main):
	* plugins/rb-plugins-engine.c: (rb_plugins_engine_load),
	(rb_plugins_engine_load_cb):
	* plugins/sample-vala/rb-sample-vala-plugin.vala:
	* plugins/visualizer/rb-visualizer-plugin.c: (get_vis_plugin_list):
	* shell/rb-shell.c: (rb_shell_finalize), (construct_widgets):
	* shell/rb-tray-icon.c: (rb_tray_icon_init):
	* tools/massif.sh:
	* widgets/rb-entry-view.c: (rb_entry_view_get_sorting_type):
	* widgets/rb-entry-view.h: fix some memory leaks. patch partially by
	John Daiker.

svn path=/trunk/; revision=5456
  • Loading branch information
James Livingston authored and James Livingston committed Nov 25, 2007
1 parent b47ad38 commit b15d748
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 86 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2007-11-25 James Livingston <[email protected]>

* bindings/python/rb.defs:
* metadata/rb-metadata-dbus-service.c: (main):
* plugins/rb-plugins-engine.c: (rb_plugins_engine_load),
(rb_plugins_engine_load_cb):
* plugins/sample-vala/rb-sample-vala-plugin.vala:
* plugins/visualizer/rb-visualizer-plugin.c: (get_vis_plugin_list):
* shell/rb-shell.c: (rb_shell_finalize), (construct_widgets):
* shell/rb-tray-icon.c: (rb_tray_icon_init):
* tools/massif.sh:
* widgets/rb-entry-view.c: (rb_entry_view_get_sorting_type):
* widgets/rb-entry-view.h: fix some memory leaks. patch partially by
John Daiker.

2007-11-25 Jonathan Matthew <[email protected]>

* backends/gstreamer/rb-player-gst-xfade.c: (dump_stream_list),
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/rb.defs
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@
(define-method get_sorting_type
(of-object "RBEntryView")
(c-name "rb_entry_view_get_sorting_type")
(return-type "const-char*")
(return-type "char*")
)

(define-method set_sorting_type
Expand Down
3 changes: 3 additions & 0 deletions metadata/rb-metadata-dbus-service.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ main (int argc, char **argv)
dbus_connection_unref (svc.connection);
}

g_object_unref (svc.metadata);
g_main_loop_unref (svc.loop);

dbus_server_disconnect (svc.server);
dbus_server_unref (svc.server);
gst_deinit ();
Expand Down
87 changes: 12 additions & 75 deletions plugins/iradio/iradio-initial.pls
Original file line number Diff line number Diff line change
@@ -1,77 +1,14 @@
[playlist]
numberofentries=25
file1=http://www.somafm.com/groovesalad.pls
title1=Groove Salad
genre1=Ambient
file2=http://www.di.fm/mp3/trance128k.pls
title2=Digitally Imported
numberofentries=4
file1=http://www.smgradio.com/core/audio/ogg/live.pls?service=vcbb
title1=Virgin Radio Classic Rock
genre1=Rock
file2=http://ubuntu.hbr1.com:19800/trance.ogg
title2=HBR1.com - I.D.M. Tranceponder
genre2=Trance
file3=http://www.digitallyimported.com/mp3/trance96k.pls
title3=Digitally Imported - Trance
genre3=Trance
file4=http://www.digitallyimported.com/mp3/progressive96k.pls
title4=Digitally Imported - Progressive
genre4=Progressive Techno
file5=http://www.digitallyimported.com/mp3/deephouse96k.pls
title5=Digitally Imported - Deep House
genre5=Deep House
file6=http://www.somafm.com/indiepop.pls
title6=Indie Pop Rocks
genre6=Indie
file7=http://www.hardcoreregime.co.uk/radio.m3u
title7=Hardcore Regime
genre7=Techno
file8=http://streams.frequence3.net/hd-mp3.m3u
title8=Frequence 3
genre8=Pop
file9=http://afterhoursdjs.org/ahdjs192.m3u
title9=AfterHoursDJs.org - All live, all the time!
genre9=Electronica
file10=http://www.smoothbeats.com/listen.pls
title10=Smoothbeats.com
genre10=Hip Hop
file11=http://www.smoothbeats.com/listen2.pls
title11=Smoothbeats.com 2
genre11=Hip Hop
file12=http://www.bassdrive.com/BassDrive.m3u
title12=Bassdrive
genre12=Drum 'n Bass
file13=http://207.200.96.225:8020/listen.pls
title13=Bluemars
genre13=Ambient/Space-Music
file14=http://www.digitallyimported.com/mp3/classictechno96k.pls
title14=Digitally Imported - Classic Techno
genre14=Techno
file15=http://stream.xtcradio.com:8069/listen.pls
title15=X T C Radio
genre15=Techno/Trance
file16=http://www.radioparadise.com/musiclinks/rp_128.m3u
title16=Radio Paradise
genre16=Rock/Pop/Alternative
file17=http://somafm.com/secretagent.pls
title17=Secret Agent
genre17=Downtempo/Lounge
file18=http://www.puredj.com/etc/pls/128K.pls
title18=Pure DJ
genre18=House
file19=http://protonradio.com/proton.m3u
title19=Proton Radio
genre19=House/Dance
file20=http://philosomatika.com/Philosomatika.pls
title20=Philosomatika
genre20=Goa
file21=http://www.mostlyclassical.com/mp3/classical96k.pls
title21=Mostly Classical
genre21=Classical
file22=http://stream.mth-house.de:8500/listen.pls
title22=MTH.House
genre22=House
file23=http://la.campus.ltu.se:8000/stream.ogg.m3u
title23=Kohina
genre23=Computer-Music
file24=http://www.smgradio.com/core/audio/ogg/live.pls?service=vr
title24=Virgin Radio UK modem
genre24=Music
file25=http://www.smgradio.com/core/audio/ogg/live.pls?service=vrbb
title25=Virgin Radio UK broadband
genre25=Music
file3=http://ubuntu.hbr1.com:19800/tronic.ogg
title3=HBR1.com - Tronic Lounge
genre3=House
file4=http://ubuntu.hbr1.com:19800/ambient.ogg
title4=HBR1.com - Dream Factory
genre4=Ambient
6 changes: 5 additions & 1 deletion plugins/rb-plugins-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ rb_plugins_engine_load (const gchar *file)
#ifndef ENABLE_PYTHON
rb_debug ("Cannot load python extension '%s', Rhythmbox was not "
"compiled with python support", file);
g_free (str);
goto error;
#endif
} else {
Expand Down Expand Up @@ -266,11 +267,14 @@ rb_plugins_engine_load_cb (const char *uri, gboolean dir, gpointer userdata)
*/
if (dir && (g_str_has_prefix (sep, "_darcs") || g_str_has_prefix (sep, "CVS"))) {
rb_debug ("not loading plugin from hidden/VCS directory %s", plugin_file);
g_free (plugin_file);
return FALSE;
}

if (dir || !g_str_has_suffix (uri, PLUGIN_EXT))
if (dir || !g_str_has_suffix (uri, PLUGIN_EXT)) {
g_free (plugin_file);
return TRUE;
}

info = rb_plugins_engine_load (plugin_file);
g_free (plugin_file);
Expand Down
1 change: 1 addition & 0 deletions plugins/sample-vala/rb-sample-vala-plugin.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GLib;
using RB;
using RhythmDB;

class SampleValaPlugin: RB.Plugin {
public override void activate (RB.Shell shell) {
Expand Down
1 change: 1 addition & 0 deletions plugins/visualizer/rb-visualizer-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,7 @@ get_vis_plugin_list (RBVisualizerPlugin *pi)

plugin_info = g_list_prepend (plugin_info, plugin);
}
gst_plugin_feature_list_free (features);
plugin_info = g_list_reverse (plugin_info);

pi->vis_plugin_list = plugin_info;
Expand Down
6 changes: 3 additions & 3 deletions shell/rb-shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,8 @@ rb_shell_finalize (GObject *object)
g_free (shell->priv->cached_notify_primary);
g_free (shell->priv->cached_notify_secondary);

g_free (shell->priv->cached_title);

if (shell->priv->cached_art_icon != NULL)
g_object_unref (shell->priv->cached_art_icon);

Expand Down Expand Up @@ -920,7 +922,7 @@ rb_shell_finalize (GObject *object)
gtk_widget_destroy (shell->priv->prefs);

rb_debug ("destroying tooltips");
gtk_object_destroy (GTK_OBJECT (shell->priv->tooltips));
g_object_unref (shell->priv->tooltips);

g_free (shell->priv->rhythmdb_file);

Expand Down Expand Up @@ -1065,8 +1067,6 @@ construct_widgets (RBShell *shell)
shell->priv->actiongroup);
gtk_widget_show_all (GTK_WIDGET (shell->priv->source_header));

shell->priv->paned = gtk_hpaned_new ();

shell->priv->sourcelist = rb_sourcelist_new (shell);
gtk_widget_show_all (shell->priv->sourcelist);
g_signal_connect_object (G_OBJECT (shell->priv->sourcelist), "drop_received",
Expand Down
1 change: 1 addition & 0 deletions shell/rb-tray-icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ rb_tray_icon_init (RBTrayIcon *icon)
g_object_ref (icon->priv->playing_image);
g_object_ref (icon->priv->not_playing_image);

gtk_container_add (GTK_CONTAINER (icon->priv->ebox), icon->priv->playing_image);
gtk_container_add (GTK_CONTAINER (icon->priv->ebox), icon->priv->not_playing_image);

gtk_container_add (GTK_CONTAINER (icon), icon->priv->ebox);
Expand Down
2 changes: 1 addition & 1 deletion tools/massif.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind --trace-children=yes --tool=massif --depth=15 --alloc-fn=g_malloc --alloc-fn=g_realloc --alloc-fn=g_try_malloc --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_alloc --alloc-fn=g_mem_chunk_alloc0 --alloc-fn=g_try_malloc0 --alloc-fn=g_try_realloc --alloc-fn=ft_alloc --alloc-fn=g_slice_alloc --alloc-fn=g_slice_alloc0 shell/rhythmbox
G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind --trace-children=yes --tool=massif --depth=15 --alloc-fn=g_malloc --alloc-fn=g_realloc --alloc-fn=g_try_malloc --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_alloc --alloc-fn=g_mem_chunk_alloc0 --alloc-fn=g_try_malloc0 --alloc-fn=g_try_realloc --alloc-fn=ft_alloc --alloc-fn=g_slice_alloc --alloc-fn=g_slice_alloc0 shell/rhythmbox $*
6 changes: 3 additions & 3 deletions widgets/rb-entry-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ rb_entry_view_sync_sorting (RBEntryView *view)
g_free (column_name);
}

const char *
char *
rb_entry_view_get_sorting_type (RBEntryView *view)
{
char *sorttype;
Expand All @@ -965,8 +965,8 @@ rb_entry_view_get_sorting_type (RBEntryView *view)
g_assert_not_reached ();
}

sorttype = g_strdup(key->str);
g_string_free (key, TRUE);
sorttype = key->str;
g_string_free (key, FALSE);

return sorttype;
}
Expand Down
4 changes: 2 additions & 2 deletions widgets/rb-entry-view.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ void rb_entry_view_set_sorting_order (RBEntryView *view,
const char *column_name,
gint sort_order);
/* deal with the sorting order as a composite string */
const char * rb_entry_view_get_sorting_type (RBEntryView *view);
void rb_entry_view_set_sorting_type (RBEntryView *view,
char * rb_entry_view_get_sorting_type (RBEntryView *view);
void rb_entry_view_set_sorting_type (RBEntryView *view,
const char *sorttype);

void rb_entry_view_set_fixed_column_width (RBEntryView *view,
Expand Down

0 comments on commit b15d748

Please sign in to comment.