diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-04-13 12:11:26 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-04-13 12:11:26 +0200 |
commit | a52d8c455caafff5bf4ae6f0b15219d3f0d38119 (patch) | |
tree | 2b0da4a70575b9b1b042b804cecdeca95a0b1c37 /src/narrative_window.c | |
parent | 0eb0908d7f5bbf1b65e502095a3c1545751f17fa (diff) |
Make clock unique to narrative window, and fix cleanup logic
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r-- | src/narrative_window.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c index 70838c7..9727e3c 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -430,7 +430,8 @@ static void last_para_sig(GSimpleAction *action, GVariant *parameter, static void open_clock_sig(GSimpleAction *action, GVariant *parameter, gpointer vp) { NarrativeWindow *nw = vp; - nw->pr_clock = pr_clock_new(); + if ( nw->pr_clock != NULL ) return; + nw->pr_clock = pr_clock_new(&nw->pr_clock); } @@ -516,6 +517,7 @@ static void scroll_down(NarrativeWindow *nw) static gboolean nw_destroy_sig(GtkWidget *da, NarrativeWindow *nw) { + if ( nw->pr_clock != NULL ) pr_clock_destroy(nw->pr_clock); g_application_release(nw->app); return FALSE; } |