gnucash/libgnucash
John Ralls b4b8431984 Bug 798778 - GnuCashquits abruptly when attempting to edit options…
for certain reports.

Those reports being ones using complex options, apparently because
the callbacks weren't protected from Guile's garbage collector.

So replace the anyway ugly hack of a void* with a std::any wrapping
a class holding a std::unique_ptr with a custom deleter. The
constructor calls scm_gc_protect_object on the SCM containing the
callback and the custom deleter calls scm_gc_unprotect_object. The
copy constructor, required for std::any, makes a new std::unique_ptr
and calls scm_gc_protect_object again ensuring that the protect and
unprotect calls are symmetrical.

Meanwhile std::any hides the Guile dependency from all the classes
that don't need to know about it. The only ugliness is that there's
no good place to put a common implementation of SCNCallbackWrapper so it's
repeated in gnc-optiondb.i and dialog-options.cpp.
2023-03-16 17:50:06 -07:00
..
app-utils Properly parse plus signs while importing numbers 2023-03-15 08:58:07 +01:00
backend Remove redundant uses of cmake -E env 2023-03-07 15:44:43 +00:00
core-utils Don't use extern "C" around #includes 2023-03-03 18:55:42 +00:00
doc Fix some typos 2023-01-26 13:48:58 +01:00
engine Bug 798778 - GnuCashquits abruptly when attempting to edit options… 2023-03-16 17:50:06 -07:00
gnc-module Merge branch 'maint' 2023-02-26 13:51:33 +08:00
quotes Add JSON::Parse to gnc-fq-update. 2023-03-10 12:51:30 -08:00
tax Add missing MAKE_LINKS, and the local scm directory to %load-path 2023-02-28 11:51:23 +00:00
CMakeLists.txt libgnucash/scm - move to bindings/guile 2019-12-06 19:59:11 +01:00