diff --git a/src/main.cc b/src/main.cc index 0012fba..3a5fbf3 100644 --- a/src/main.cc +++ b/src/main.cc @@ -63,6 +63,10 @@ public: bool init (); void cleanup (); + + // No gtk window, SDL creates its own window. + // void * get_gtk_widget (); + void clear (); void render_multi_pcm (const float * pcm, int channels); @@ -94,12 +98,12 @@ bool InfinityPlugin::init(void) void InfinityPlugin::clear () { - g_message("[Infinity] clear()"); + g_message("Infinity: clear()"); } void InfinityPlugin::cleanup(void) { - g_message("[Infinity] cleanup()"); + g_message("Infinity: cleanup()"); config_save_prefs(); renderer_finish(); } diff --git a/src/renderer.cc b/src/renderer.cc index 6226912..b2de92b 100644 --- a/src/renderer.cc +++ b/src/renderer.cc @@ -20,8 +20,9 @@ #include #include -#include #include +#include +#include #include #include @@ -87,9 +88,6 @@ static int renderer_mmx(void *); #endif static void set_title(void); -/* - * Public functions - */ void renderer_init(void) { GError *error = NULL; @@ -156,7 +154,10 @@ void renderer_init(void) void renderer_finish(void) { gint32 _try; + PluginHandle * plugin; + if (finished) + return; if (initializing) { g_warning("The plugin have not yet initialized"); _try = 0; @@ -184,6 +185,10 @@ void renderer_finish(void) display_quit(); g_timer_destroy(title_timer); g_object_unref(dbus_proxy); + + plugin = aud_plugin_lookup_basename("libinfinite"); + aud_plugin_enable(plugin, false); + g_message("Infinity: Closing..."); } @@ -230,7 +235,7 @@ static gint32 event_filter(const SDL_Event *event) } break; case SDL_QUIT: - config_save_prefs(); + // ignore it. let handle it in check_events() break; default: break;