2.5.4mtn loses loaded plugins at shutdown (Was Re: pidgin: c1eb11b6: Rearrange prefs uninitialization now tha...)

Paul Aurich paul at aurich.com
Thu Jan 8 04:15:47 EST 2009


And datallah at pidgin.im spake on 01/03/2009 10:40 AM, saying:
> -----------------------------------------------------------------
> Revision: c1eb11b61c6c6756eba2e3aa380e4e4e09db0914
> Ancestor: b478b184a46116ac87ac85b8cd352ea564224019
> Author: datallah at pidgin.im
> Date: 2009-01-03T18:37:37
> Branch: im.pidgin.pidgin
> URL: http://d.pidgin.im/viewmtn/revision/info/c1eb11b61c6c6756eba2e3aa380e4e4e09db0914
>
> Modified files:
>         libpurple/core.c libpurple/prefs.c
>
> ChangeLog: 
>
> Rearrange prefs uninitialization now that it actually does something.
> This should prevent an infinite loop that occurs when trying to debug after
> prefs are uninit'd.  Paul Aurich figured this out.
> Fixes #7761
>
>   
> ------------------------------------------------------------------------
>
> ============================================================
> --- libpurple/core.c	361874bd3f2080adc3d38101a73fdf5ff2e65f56
> +++ libpurple/core.c	4b25950b0f744009084a69c33a2707720965efc0
> @@ -137,7 +137,7 @@ purple_core_init(const char *ui)
>  	 * subsystem right away too.
>  	 */
>  	purple_plugins_init();
> -	
> +
>  	/* Initialize all static protocols. */
>  	static_proto_init();
>  
> @@ -213,7 +213,6 @@ purple_core_quit(void)
>  	purple_accounts_uninit();
>  	purple_savedstatuses_uninit();
>  	purple_status_uninit();
> -	purple_prefs_uninit();
>  	purple_sound_uninit();
>  	purple_xfers_uninit();
>  	purple_proxy_uninit();
> @@ -244,6 +243,7 @@ purple_core_quit(void)
>  #ifdef _WIN32
>  	wpurple_cleanup();
>  #endif
> +	purple_prefs_uninit();
>  
>  	_core = NULL;
>  }
> ============================================================
> --- libpurple/prefs.c	155bb1ed1363d3d72bfc07cb890818a4cdb90e3d
> +++ libpurple/prefs.c	e9a35b12de92bde6154b4bedbcab78939f50c3e7
> @@ -714,7 +714,8 @@ remove_pref(struct purple_pref *pref)
>  
>  	name = pref_full_name(pref);
>  
> -	purple_debug_info("prefs", "removing pref %s\n", name);
> +	if (prefs_loaded)
> +		purple_debug_info("prefs", "removing pref %s\n", name);
>  
>  	g_hash_table_remove(prefs_hash, name);
>  	g_free(name);
> @@ -1453,7 +1454,7 @@ purple_prefs_uninit()
>  		save_timer = 0;
>  		sync_prefs();
>  	}
> -
> +	prefs_loaded = FALSE;
>  	purple_prefs_disconnect_by_handle(purple_prefs_get_handle());
>  	purple_prefs_destroy();
>  	g_hash_table_destroy(prefs_hash);
>   
> ------------------------------------------------------------------------

I'm pretty sure this change and the previous one, 59dabca5, now cause me
to lose all of my loaded plugins when I shut down Pidgin, since the
plugins are destroyed (and /pidgin/plugins/loaded cleared, I guess) and
then purple_prefs_uninit() is called, which forces a saving of
prefs.xml, where previously the 5 second timer wouldn't expire before
Pidgin quits.*

This should probably get fixed before 2.5.4 : )
~Paul

*That's all a wild guess; I didn't closely follow the code paths.




More information about the Devel mailing list