Crash hiding scrollbar after opening/closing a few times
#### Steps to reproduce: - open Inkscape - Ctrl+N (new window) - Ctrl+B (hide scrollbar) - Ctrl+W (close document and thus window) - Repeat last 3 steps 3-4 times. Ctrl+B will show (not hide) the scrollbar every second time #### What happened? - Crash on hiding scrollbar - Backtrace in Inkscape 1.1-dev (8d201ce056, 2021-01-09) [inkscape-backtrace-hide-scrollbar.txt](/uploads/88c4087fae9481aaa999179fbe13c281/inkscape-backtrace-hide-scrollbar.txt) - Truncated backtrace: ``` Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f08a2729ee2 in __dynamic_cast () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 [Current thread is 1 (Thread 0x7f089bcdcb40 (LWP 219009))] (gdb) set pagination off (gdb) bt #0 0x00007f08a2729ee2 in __dynamic_cast () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x00007f08a3a6e2f8 in set_menuitems(unsigned int, bool) (emitting_verb=193, value=<optimised out>) at ../src/ui/desktop/menubar.cpp:124 ... (sigc signal stuff) #7 SPDesktop::toggleScrollbars() (this=this@entry=0x555907936540) at ../src/desktop.cpp:1346 ``` - ![inkscape-scrollbar](/uploads/83a5ef7caeb519e00d5df05f5ac815aa/inkscape-scrollbar.mp4) #### What should have happened? - No crash Sample attachments: [inkscape-backtrace-hide-scrollbar.txt](/uploads/9f1e2844c35d6ecead291f4e4df48513/inkscape-backtrace-hide-scrollbar.txt) and [inkscape-scrollbar](/uploads/66b80733a65858aa8cf1175db544214d/inkscape-scrollbar.mp4) #### Version Info: - Inkscape 1.0.1 (179fe94779, 2021-01-06) Linux Mint 20 - Inkscape 1.1-dev (8d201ce056, 2021-01-09) Linux Mint 20 Bisection points to commit inkscape@a7e562fc5b5f2c6a41548eaee85d9803cada7621 ``` Author: Jabiertxof <jabier.arraiza@marker.es> Date: Sun Jul 28 18:59:09 2019 +0200 Add Patrick improvements to verbs toggle menu items src/desktop.cpp | 21 ++++++++++---------- src/desktop.h | 2 +- src/object/sp-namedview.cpp | 5 +++-- src/object/sp-namedview.h | 2 +- src/ui/desktop/menubar.cpp | 45 ++++++++++++++++++++++-------------------- src/ui/desktop/menubar.h | 1 + src/verbs.cpp | 2 +- src/widgets/desktop-widget.cpp | 2 +- 8 files changed, 43 insertions(+), 37 deletions(-) ``` Relevant MRs: https://gitlab.com/inkscape/inkscape/-/merge_requests/803 and subsequently https://gitlab.com/inkscape/inkscape/-/merge_requests/800 Note: earlier commits only required 2 Ctrl+N to replicate the issue.
issue