added destroy() function to WI_ITEM_REC. This fixes a potential crash when

"window item destroy" signal was being used.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1655 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-07-26 01:49:08 +00:00 committed by cras
commit 3fb7a4115d
7 changed files with 22 additions and 52 deletions

View file

@ -48,6 +48,7 @@ void channel_init(CHANNEL_REC *channel, int automatic)
MODULE_DATA_INIT(channel);
channel->type = module_get_uniq_id_str("WINDOW ITEM TYPE", "CHANNEL");
channel->destroy = (void (*) (WI_ITEM_REC *)) channel_destroy;
channel->mode = g_strdup("");
channel->createtime = time(NULL);
channel->get_join_data = get_join_data;

View file

@ -36,6 +36,7 @@ void query_init(QUERY_REC *query, int automatic)
MODULE_DATA_INIT(query);
query->type = module_get_uniq_id_str("WINDOW ITEM TYPE", "QUERY");
query->destroy = (void (*) (WI_ITEM_REC *)) query_destroy;
if (query->server_tag != NULL) {
query->server = server_find_tag(query->server_tag);
if (query->server != NULL) {

View file

@ -12,4 +12,6 @@ time_t createtime;
int data_level;
char *hilight_color;
void (*destroy)(WI_ITEM_REC *item);
#undef STRUCT_SERVER_REC