Skip to content

Commit 500260e

Browse files
Add files via upload
Correct shutdown tasks.
1 parent a984e39 commit 500260e

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

main.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@
6969
// Ubuntu has left widget alignment/margin problem.
7070
// NK_COLOR_SLIDER_CURSOR_ACTIVE not working linux?
7171
//
72+
// Window Close dialog does not return on Cancel!! [Done]
73+
//
74+
//-lmingw32
75+
//
76+
// Fix NK shutdown tasks!!! [Done]
77+
//nk_allegro5_del_image(logo);[Done]
78+
//nk_allegro5_del_image(backgrounds);[Done]
79+
//al_destroy_event_queue(event_queue);[Done]
80+
81+
//nk_allegro5_shutdown();[Done]
7282
//------------------------------------------------------------------------------
7383

7484
#include <stdio.h>
@@ -298,7 +308,7 @@ int main(void)
298308
nk_input_end(ctx);
299309

300310
// GUI
301-
//nk_theme(ctx, display, table, logo, &img_select, nk_bk_color, font, font_l, &alpha_flag, &alpha_all, &quit_app);
311+
nk_theme(ctx, display, table, logo, &img_select, nk_bk_color, font, font_l, &alpha_flag, &alpha_all, &quit_app);
302312

303313
// Draw
304314

@@ -334,13 +344,21 @@ int main(void)
334344

335345
}
336346

337-
// check cleanup tasks!!
347+
// Do cleanup tasks.
338348
al_shutdown_native_dialog_addon();
339349
nk_allegro5_font_del(font);
350+
nk_allegro5_font_del(font_l);
351+
nk_allegro5_del_image(logo);
340352
nk_allegro5_shutdown();
341-
al_destroy_display(display); // Is the order correct?
342-
//nk_allegro5_del_image(logo);
353+
354+
al_destroy_bitmap(icon);
355+
al_destroy_bitmap(background[0]);
356+
al_destroy_bitmap(background[1]);
357+
al_destroy_bitmap(background[2]);
343358
al_destroy_event_queue(event_queue);
359+
al_destroy_display(display);
360+
al_uninstall_keyboard();
361+
al_uninstall_mouse();
344362

345363
return 0;
346364
}

0 commit comments

Comments
 (0)