mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
unix: Unref SDL_gtk context on quit
This commit is contained in:
parent
e1af623631
commit
0c5f7f6a33
2 changed files with 7 additions and 1 deletions
|
|
@ -64,6 +64,11 @@ static gulong signal_connect(gpointer instance, const gchar *detailed_signal, vo
|
|||
|
||||
static void QuitGtk(void)
|
||||
{
|
||||
if (sdl_main_context) {
|
||||
gtk.g.main_context_unref(sdl_main_context);
|
||||
sdl_main_context = NULL;
|
||||
}
|
||||
|
||||
SDL_UnloadObject(libgdk);
|
||||
SDL_UnloadObject(libgtk);
|
||||
|
||||
|
|
@ -137,6 +142,7 @@ static bool InitGtk(void)
|
|||
SDL_GTK_SYM(gtk, libgdk, g, main_context_push_thread_default);
|
||||
SDL_GTK_SYM(gtk, libgdk, g, main_context_pop_thread_default);
|
||||
SDL_GTK_SYM(gtk, libgdk, g, main_context_new);
|
||||
SDL_GTK_SYM(gtk, libgdk, g, main_context_unref);
|
||||
SDL_GTK_SYM(gtk, libgdk, g, main_context_acquire);
|
||||
SDL_GTK_SYM(gtk, libgdk, g, main_context_iteration);
|
||||
|
||||
|
|
@ -192,7 +198,6 @@ void SDL_Gtk_Quit(void)
|
|||
|
||||
QuitGtk();
|
||||
SDL_zero(gtk);
|
||||
sdl_main_context = NULL;
|
||||
|
||||
SDL_SetInitialized(>k_init, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ typedef struct SDL_GtkContext
|
|||
void (*main_context_push_thread_default)(GMainContext *context);
|
||||
void (*main_context_pop_thread_default)(GMainContext *context);
|
||||
GMainContext *(*main_context_new)(void);
|
||||
void (*main_context_unref)(GMainContext *context);
|
||||
gboolean (*main_context_acquire)(GMainContext *context);
|
||||
gboolean (*main_context_iteration)(GMainContext *context, gboolean may_block);
|
||||
} g;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue