WIP: clean error for alloc problems

This commit is contained in:
Adrien Bourmault 2023-02-23 20:03:36 +01:00
parent 4e291bc179
commit 0a7c9d28d3
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 6 additions and 2 deletions

View File

@ -227,7 +227,9 @@ void on_realize(GtkWidget *widget)
if(gtk_gl_area_get_error(GTK_GL_AREA(widget)) != NULL)
return;
graphics_init((void*)&widget);
if (graphics_init((void*)&widget) == false) {
ui_send_internal_notification("Failed to allocate GLArea !");
}
}
/* We should tear down the state when unrealizing */
@ -238,7 +240,9 @@ void on_unrealize(GtkWidget *widget)
if(gtk_gl_area_get_error(GTK_GL_AREA(widget)) != NULL)
return;
graphics_shutdown((void*)&widget);
if (graphics_shutdown((void*)&widget)) {
ui_send_internal_notification("Failed to allocate GLArea !");
}
}
void on_close_window(GtkWidget *widget)