im.pidgin.cpw.resiak.disconnectreason: 34ce10dafb0a1d17a13870eba0b81fab52f6bc4a

resiak at soc.pidgin.im resiak at soc.pidgin.im
Tue Oct 30 20:35:50 EDT 2007


-----------------------------------------------------------------
Revision: 34ce10dafb0a1d17a13870eba0b81fab52f6bc4a
Ancestor: 2f6cfbb13f8fd272bcb29a63c02693d679138047
Author: resiak at soc.pidgin.im
Date: 2007-10-30T21:38:14
Branch: im.pidgin.cpw.resiak.disconnectreason

Modified files:
        doc/account-signals.dox libpurple/account.c
        libpurple/account.h

ChangeLog: 

Document exactly how long the PurpleConnectionErrorInfo pointers given out by
account-error-changed and purple_account_get_current_error() are valid.

-------------- next part --------------
============================================================
--- doc/account-signals.dox	79d2864a4cedc1e9728f453590302bf996008acf
+++ doc/account-signals.dox	8e8b4c549075e4e4041f150d323442367e3264f3
@@ -150,8 +150,12 @@ void (*account_error_changed)(PurpleAcco
    Emitted when @a account's error changes.
   @param account   The account whose error has changed.
   @param old_error The account's previous error, or @c NULL if it had no
-                   error.
+                   error.  After this signal is emitted, @a old_error is
+                   not guaranteed to be a valid pointer.
   @param new_error The account's new error, or @c NULL if it has no error.
+                   If not @c NULL, @a new_error will remain a valid until
+                   pointer just after the next time this signal is emitted
+                   for this @a account.
   @see purple_account_get_current_error()
   @since 2.3.0
  @endsignaldef
============================================================
--- libpurple/account.c	4fe840a4238c15f107ec994d179046c2ac785677
+++ libpurple/account.c	cd5e5c72660963eaf621541104117b12d64fe75d
@@ -2309,6 +2309,10 @@ purple_accounts_remove(PurpleAccount *ac
 
 	schedule_accounts_save();
 
+	/* Clearing the error ensures that account-error-changed is emitted,
+	 * which is the end of the guarantee that the the error's pointer is
+	 * valid.
+	 */
 	clear_current_error(account);
 	purple_signal_emit(purple_accounts_get_handle(), "account-removed", account);
 }
============================================================
--- libpurple/account.h	58dde9ed7c9165605e148c61d8c881308c98b45f
+++ libpurple/account.h	796cbc3bd9ee667f7530e6ec38c102c5dc43a9f9
@@ -901,7 +901,9 @@ gboolean purple_account_supports_offline
  *
  * @param account The account whose error should be retrieved.
  * @constreturn   The type of error and a human-readable description of the
- *                current error, or @c NULL if there is no current error.
+ *                current error, or @c NULL if there is no current error.  This
+ *                pointer is guaranteed to remain valid until the @ref
+ *                account-error-changed signal is emitted for @a account.
  */
 const PurpleConnectionErrorInfo *purple_account_get_current_error(PurpleAccount *account);
 


More information about the Commits mailing list