diff options
author | Michael Webster <miketwebster@gmail.com> | 2017-06-20 11:28:09 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-06-20 11:28:09 +0200 |
commit | d68171ebaceaa1b6ead605e9cd5bb68c680ccd8a (patch) | |
tree | cd7bb215a5ad47c2b905189742a0a2e91328273e /src | |
parent | 29eb6f83f6b9af5635952a3d117e1725ef9439e8 (diff) | |
download | arctica-greeter-d68171ebaceaa1b6ead605e9cd5bb68c680ccd8a.tar.gz arctica-greeter-d68171ebaceaa1b6ead605e9cd5bb68c680ccd8a.tar.bz2 arctica-greeter-d68171ebaceaa1b6ead605e9cd5bb68c680ccd8a.zip |
src/prompt-box.vala: Avoid 'pango_layout_get_cursor_pos: assertion 'index >= 0 && index <= layout->length' failed' error.
Diffstat (limited to 'src')
-rw-r--r-- | src/prompt-box.vala | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/prompt-box.vala b/src/prompt-box.vala index 6d5bc13..9901d4f 100644 --- a/src/prompt-box.vala +++ b/src/prompt-box.vala @@ -374,7 +374,23 @@ public class PromptBox : FadableBox public void clear () { prompt_visibility = PromptVisibility.HIDDEN; - foreach_prompt_widget ((w) => { w.destroy (); }); + + /* Hold a ref while removing the prompt widgets - + * if we just do w.destroy() we get this warning: + * CRITICAL: pango_layout_get_cursor_pos: assertion 'index >= 0 && index <= layout->length' failed + * by GtkWidget's screen-changed signal being called on + * widget when we destroy it. + */ + foreach_prompt_widget ((w) => { +#if HAVE_GTK_3_20_0 + w.ref (); + w.get_parent().remove(w); + w.unref (); +#else + w.destroy (); +#endif + }); + reset_last_row (); has_errors = false; } |