SUMMARY When in one-instance mode, opening another instance of Krita will result in destructor calling database functions that don't work because the database hasn't been open. STEPS TO REPRODUCE 1. Make sure you have multiple instances of Krita disabled (it's like that by default) 2. Open Krita. 3. Open Krita again from console. OBSERVED RESULT A log that complains about errors with database due to "driver not loaded". (Note: from a developer point of view, it looks like a problem with SQL, especially now that there were a lot of weird issues...) EXPECTED RESULT No errors from the database (possibly a debug line "Krita closes because of multiple instances not being allowed"). SOFTWARE/OS VERSIONS Krita Version: 5.0.0-prealpha (git dde4967) (3145ca0914 on master, last hash is my local) Languages: pl, pl_PL, pl Hidpi: true Qt Version (compiled): 5.11.1 Version (loaded): 5.11.1 OS Information Build ABI: x86_64-little_endian-lp64 Build CPU: x86_64 CPU: x86_64 Kernel Type: linux Kernel Version: 5.3.7-050307-generic Pretty Productname: Linux Mint 19.3 Product Type: linuxmint Product Version: 19.3 Desktop: X-Cinnamon
We'll have to disable multi-process mode completely to solve this, or use something like mysql/mariadb which allows concurrent database access (with all the hairy problems that will give us.)
We can just return from the function ("remove temporary something") if the database is not open, can't we?
If we cannot open the database, we can do nothing...
Exactly, but now in the single-instance mode, if Krita sees that another instance of Krita is already open, then it closes, calls the destructor, and the destructor tries to remove stuff from a database that wasn't open because, most probably, the opening calls are further down than checking whether we should close Krita early. So either in destructor or in the removeTemporary... call itself it should check if the database it tries to operate on is open and valid.
Git commit 0ddaf9ffefc4433ac11f3c40498ff088d7d1edd3 by Boudewijn Rempt. Committed on 15/04/2020 at 08:51. Pushed by rempt into branch 'master'. Remove the option to run krita in multiple processes This is not compatible with using a database like sqlite, which doesn't allow concurrent access. Besides, changing the contents of the database from two krita processes would lead to massive confusion. M +1 -4 krita/main.cc M +1 -4 libs/ui/dialogs/kis_dlg_preferences.cc M +7 -27 libs/ui/forms/wdggeneralsettings.ui https://invent.kde.org/kde/krita/commit/0ddaf9ffefc4433ac11f3c40498ff088d7d1edd3