Changeset 8dbe021f for root_commands.c


Ignore:
Timestamp:
2008-04-04T23:13:07Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f3351f0
Parents:
883a398
Message:

Don't pass an account_t pointer directly to query_add() since query_del()
wants to free it! Passing an indirect pointer instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r883a398 r8dbe021f  
    206206void cmd_account_del_yes( gpointer w, void *data )
    207207{
    208         account_t *a = data;
    209         irc_t *irc = a->irc;
    210        
    211         if( a->ic )
     208        account_t **aptr = data;
     209        irc_t *irc = (*aptr)->irc;
     210       
     211        if( (*aptr)->ic )
    212212        {
    213213                irc_usermsg( irc, "Account is still logged in, can't delete" );
     
    215215        else
    216216        {
    217                 account_del( irc, a );
     217                account_del( irc, (*aptr) );
    218218                irc_usermsg( irc, "Account deleted" );
    219219        }
     220        g_free( aptr );
    220221}
    221222
    222223void cmd_account_del_no( gpointer w, void *data )
    223224{
     225        g_free( data );
    224226}
    225227
     
    278280                else
    279281                {
     282                        account_t **aptr;
    280283                        char *msg;
     284                       
     285                        aptr = g_malloc( sizeof( aptr ) );
     286                        *aptr = a;
    281287                       
    282288                        msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will "
     
    285291                                               "set' command. Are you sure you want to delete this "
    286292                                               "account?", a->prpl->name, a->user );
    287                         query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, a );
     293                        query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, aptr );
    288294                        g_free( msg );
    289295                }
Note: See TracChangeset for help on using the changeset viewer.