terminal: fix unregistering display callbacks when removing screens

We must unregister the display callback when removing a screen. Otherwise,
we keep writing to the screen memory which becomes invalid then.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-12-01 18:22:38 +01:00
parent 4cd7b696d3
commit 00297c43cc

View File

@ -295,6 +295,7 @@ static void free_screen(struct screen *scr, bool update)
kmscon_text_unref(scr->txt);
kmscon_font_unref(scr->bold_font);
kmscon_font_unref(scr->font);
uterm_display_unregister_cb(scr->disp, display_event, scr);
uterm_display_unref(scr->disp);
free(scr);