gnucash/bindings
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
..
guile Bug 798778 - GnuCashquits abruptly when attempting to edit options… 2023-03-16 17:50:06 -07:00
python Remove unused ${GLIB_LIBS} ${GLIB_INCLUDE_DIRS} 2023-02-21 12:50:38 +00:00
app-utils.i Use internal extern "C" { ... } for C++ 2023-01-23 18:40:01 +00:00
business-core.i Merge Richard Cohen's 'cleanup' into master. 2023-01-24 12:05:47 -08:00
CMakeLists.txt Move gnc_ui_account_get_tax_info_string to gnc-locale-tax.c 2022-07-17 10:00:23 -07:00
core-utils.i Bindings - move log wrappers into the swig interface files 2022-10-02 11:50:26 -07:00
engine-common.i [account.cpp] gnc_accounts_and_all_descendants converted from scm 2022-04-14 21:51:14 +08:00
engine.i Use internal extern "C" { ... } for C++ 2023-01-23 18:40:01 +00:00
expressions.i Move gnc_ui_account_get_tax_info_string to gnc-locale-tax.c 2022-07-17 10:00:23 -07:00