Comment 9 for bug 869067

Revision history for this message
Johan Engelen (johanengelen) wrote :

OK, I think I've figured out what the problem is, but do not know how to fix this. Hopefully Jon or Krzys can have a look at it.
To avoid confusion, I'll use the following names:
1.) Start inkscape -> you'll see Desktop1
2.) Create new document (click on the new document icon) -> creates Desktop2
3.) Close new document -> closes Desktop2
4.) Create a new document again -> creates Desktop3

The problem is caused by the fact that the SPDesktop pointers for Desktop2 and Desktop3 are the same. The "create_or_fetch_actions" function in /src/widgets/toolbox.cpp should create a new action group for Desktop3, but because it does a lookup in a table using the SPDesktop pointer (line 939), it finds that there is already an action group for that pointer and does not create a new one. This results in all the errors about non-unique actions when Inkscape tries to populate the action group while Inkscape thinks it is new for Desktop3.
When Desktop2 is destroyed, its associated toolbars are not destroyed, neither is the action group. So the action group still lingers in this lookup table. So the proper way to fix this is to delete the toolbars and all when Desktop2 is destroyed, and remove the entry from the lookup table.

Hope that helps.