Skip to content

Draft: Extension db cache fixes

Ted Gould requested to merge ted.gould/inkscape:extension-db-cache-fixes into master

These are the extension fixes that were part of the Wasmer branch, but I'm pulling them out as the Wasmer stuff isn't immediately mergable and these are useful regardless. Most of them are updates in C++ style or smaller bug fixes.

  • There were a couple cases where we were losing the Document Cache in the script implementation, especially on errors. I switched all of the doccache functions to be std::shared_ptr<> based so that it will get free'd correctly.

  • The foreach function on the DB object took a function pointer, but I switched this to std::function so that it could take lambdas. This meant that quite a few usages of it could be cleaned up and we didn't need nearly as many helper functions. Also, this allowed for dropping of the modulelist variable.

  • Moved replace_document and copydoc into the implementation base class instead of the Script class so that they can be used by more subclasses as they aren't script specific.

  • When I touched some of these files that hadn't been touched in a while, the code reformatter got super excited.

Edited by Ted Gould

Merge request reports