Memory leak when Ctrl+W documents

Summary:

Inkscape is leaking a lot of memory when closing and opening a new document using Ctrl+W.

Steps to reproduce:

  1. open Inkscape
  2. Look at task manager and notice the memory usage is around 82,000K.
  3. Go back to Inkscape, and hold the Ctrl+W buttons till the title bar says 'New Document 500'.

What happened?

Inkscape memory usage in Task Manager is around 310,000K.

What should have happened?

Memory usage should still be around 82,000K.

Tested the same process with 1.0.2-2 (e86c870879, 2021-01-15), and memory usage didn't go above ~73,000K after getting up to New Document 500. So, definitely a regression/memory leak here.

Version info

Inkscape 1.1 (c68e22c387, 2021-05-23)  (64-bit version)
Windows 7 SP1 x64