mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Free plugin autocompleters on shutdown
This commit is contained in:
parent
8831715f7a
commit
9d96ae5190
@ -31,7 +31,7 @@ static GHashTable *autocompleters;
|
|||||||
void
|
void
|
||||||
autocompleters_init(void)
|
autocompleters_init(void)
|
||||||
{
|
{
|
||||||
autocompleters = g_hash_table_new(g_str_hash, g_str_equal);
|
autocompleters = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)autocomplete_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -72,4 +72,9 @@ autocompleters_reset(void)
|
|||||||
autocomplete_reset(curr->data);
|
autocomplete_reset(curr->data);
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void autocompleters_destroy(void)
|
||||||
|
{
|
||||||
|
g_hash_table_destroy(autocompleters);
|
||||||
}
|
}
|
@ -29,5 +29,6 @@ void autocompleters_init(void);
|
|||||||
void autocompleters_add(const char *key, char **items);
|
void autocompleters_add(const char *key, char **items);
|
||||||
char* autocompleters_complete(char *input, int *size);
|
char* autocompleters_complete(char *input, int *size);
|
||||||
void autocompleters_reset(void);
|
void autocompleters_reset(void);
|
||||||
|
void autocompleters_destroy(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -413,6 +413,8 @@ plugins_shutdown(void)
|
|||||||
#ifdef PROF_HAVE_C
|
#ifdef PROF_HAVE_C
|
||||||
c_shutdown();
|
c_shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
autocompleters_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
typedef char*(*autocomplete_func)(char *);
|
typedef char*(*autocomplete_func)(char *);
|
||||||
typedef struct autocomplete_t *Autocomplete;
|
typedef struct autocomplete_t* Autocomplete;
|
||||||
|
|
||||||
// allocate new autocompleter with no items
|
// allocate new autocompleter with no items
|
||||||
Autocomplete autocomplete_new(void);
|
Autocomplete autocomplete_new(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user