Skip to content

Commit

Permalink
lib-program-client: Make sure program client callback is called only …
Browse files Browse the repository at this point in the history
…once.
  • Loading branch information
stephanbosch authored and cmouse committed Mar 18, 2018
1 parent 36e44c0 commit c1d11ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib-program-client/program-client.c
Expand Up @@ -23,10 +23,11 @@ static void
program_client_callback(struct program_client *pclient, int result,
void *context)
{
/* do not call callback when destroying */
if (pclient->destroying) return;
program_client_callback_t *callback = pclient->callback;
i_assert(pclient->callback != NULL);

pclient->callback = NULL;
if (pclient->destroying || callback == NULL)
return;
callback(result, context);
}

Expand Down

0 comments on commit c1d11ef

Please sign in to comment.