Crash closing multipage file with Export dialog docked

Summary:

Inkscape crashes when the document is closed (not the window) if the file has multiple pages and Export dialog is open

Steps to reproduce:

  • open Inkscape
  • Create a few pages
  • Open Export Dialog, with pages tab active
  • Close with Ctrl+W

What happened?

Inkscape crashes and closes.

What should have happened?

No crash

Version info

Inkscape 1.3 (0e150ed6, 2023-07-21)

<pre>
 0# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >::init(unsigned long long, unsigned long long) in libinkscape_base
 1# Inkscape::Application::crash_handler(int) in libinkscape_base
 2# 0x00007FF6B18421B2 in inkscape
 3# _C_specific_handler in ntdll
 4# _chkstk in ntdll
 5# _RtlRaiseException in ntdll
 6# _KiUserExceptionDispatcher in ntdll
 7# SPItem::invoke_show(Inkscape::Drawing&, unsigned int, unsigned int) in libinkscape_base
 8# Inkscape::UI::Dialog::PreviewDrawing::construct() in libinkscape_base
 9# Inkscape::UI::Dialog::PreviewDrawing::construct() in libinkscape_base
10# Glib::IdleSource::dispatch(sigc::slot_base*) in libglibmm_2_4_1
11# _g_source_get_time in libglib_2_0_0
12# _g_clear_list in libglib_2_0_0
13# _g_main_context_check in libglib_2_0_0
14# _g_main_context_iteration in libglib_2_0_0
15# _g_application_run in libgio_2_0_0
16# 0x00007FF6B18437BB in inkscape
17# 0x00007FF6B18412EE in inkscape
18# 0x00007FF6B18413E6 in inkscape
19# _BaseThreadInitThunk in KERNEL32
20# _RtlUserThreadStart in ntdll
</pre>
<details><summary>System info</summary>
Inkscape 1.3 (0e150ed6c4, 2023-07-21)

    GLib version:     2.76.4
    GTK version:      3.24.38
    glibmm version:   2.66.6
    gtkmm version:    3.24.7
    libxml2 version:  2.11.4
    libxslt version:  1.1.38
    Cairo version:    1.17.7
    Pango version:    1.50.14
    HarfBuzz version: 8.0.1

    OS version:       Windows 10 22H2
</details>

Edited by KrIr17