Examples: Allegro 5: Properly destroy all globals on shutdown. (#2262)

This commit is contained in:
DomRe
2019-01-04 20:11:24 +08:00
committed by omar
parent 6777544855
commit 4483320f0a
2 changed files with 8 additions and 2 deletions

View File

@ -280,9 +280,14 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
void ImGui_ImplAllegro5_Shutdown()
{
ImGui_ImplAllegro5_InvalidateDeviceObjects();
g_Display = NULL;
// Destroy last known clipboard data
g_Display = NULL;
g_Time = 0.0;
if (g_VertexDecl)
al_destroy_vertex_decl(g_VertexDecl);
g_VertexDecl = NULL;
if (g_ClipboardTextData)
al_free(g_ClipboardTextData);
g_ClipboardTextData = NULL;