diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-11 11:30:27 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-11 11:30:27 +0100 | 
| commit | 1e52e1ff518987092cfe94bc5c9c4479ed535019 (patch) | |
| tree | 59a0f7c6725f37703797b8825058356ec6bf1f27 /query.h | |
| parent | e92c4f4f63ca0ba9ac6f959f7ff894ad2fc72a04 (diff) | |
When cleaning up queries, q->data is free()d. Even if it turns out to be
the "struct irc" containing all data belonging to a session. Sanitise
memory management a little bit here. (There are some memory leaks in here
too that need to be fixed at some point.)
Diffstat (limited to 'query.h')
| -rw-r--r-- | query.h | 5 | 
1 files changed, 3 insertions, 2 deletions
@@ -32,13 +32,14 @@ typedef struct query  {  	struct im_connection *ic;  	char *question; -	query_callback yes, no; +	query_callback yes, no, free;  	void *data;  	struct query *next;  } query_t;  query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, -                    query_callback yes, query_callback no, void *data ); +                    query_callback yes, query_callback no, query_callback free, +                    void *data );  void query_del( irc_t *irc, query_t *q );  void query_del_by_conn( irc_t *irc, struct im_connection *ic );  void query_answer( irc_t *irc, query_t *q, int ans );  | 
