The core issue was that the delete visitor was never called because its parameter
type (char *) didn't match the boost::variant type (const char *).
Fixing the visitor's parameter type also require a const_cast
back to char * because that's what g_free takes as argument.
The rest of this commit is merely fixing KvpValue instantiations that
tried to create a char* KvpValue from a stack based const string instead
of a heap allocated one. That would bomb out on calling the
delete visitor.
Splits were not marked for deletion if the transaction is read-only
and the account is not marked for deletion yet. The net result is
that split will not be freed later on.
However xaccSplitDestroy is also called from a Transaction's do_destroy.
At that point accounts are not necessarily marked for deletion yet (like
is the case when a datafile is closed). This turned out to be a problem
for invoice post transactions (which are also read only) and hence
would cause memory to leak.
1. LC_ALL should set default-report-currency to USD
2. change test monetary output from list-of-strings '("$25.00") to
monetary pairs '(("USD" . 25)) which should be locale independent.
Always use absolute paths for configured directories (BINDIR etc.)
Abstract out the guts of gnc_gbr_find_foo_dir for foo in lib, bin, and data.
etc requires special handling because of the way it's treated if prefix
begins with /opt.
Always fall back on the configured directory if binreloc is disabled and
no default is passed in.
The table storing cell dimensions was never freed. The size of this table is
directly proportional to the number of cells in the register. So the more
transactions/splits in a register, the more memory was leaked - each time
a register was opened and closed. With my huge test book I saw leaks of
4Mb-10Mb per page that was opened/closed.
These functions are not actually exported in report-system.scm so they
are not generally available to external reports. It should mean
they're safe to remove.
collectors are accumulator-type objects, being mutated with each call,
rather than functional objects. (map) is meant for functional
constructs, returning a list to current continuation. We're not using
the (map) output, so, change it to (for-each) to emphasise this.
The last three commits fix the main part of Bug 796137. An inconvenience
with GSList remains as for the moment qof_query_add_boolean_match only
accepts bytes as parameter and no strings. This still needs to be fixed.
Patch by David Osguthorpe to provide typemaps so that SWIG doesn't
free buffers mem when buffer is saved as part of query struct leading
to garbage content. See https://bugs.gnucash.org/show_bug.cgi?id=796137
In the previous update the changes to 'double_line mode' and 'register
style' were not catered for so this commit fixes that by using a stored
value 'enable_refresh' in the GncPluginPageRegister. This value is used
to enable/disable the triggering of gnc_ledger_display_refresh command
instead of passing a parameter as these settings are triggered by call
backs. The value is set to FALSE in ...recreate_page before restoring
all settings and subsequently set to TRUE after so normal refreshing
can occur. This reduces the potential number of refreshes on load from
7 to 2.
The results of the find are displayed in a search_ledger but with reset
filter settings. As part of the initial setup of the filter, the
SPLIT_RECONCILE and TRANS_DATE_POSTED parameters are purged from the
query and so if 'Date Posted' was used, all transactions were displayed
so this commit tests for a search_ledger and stops the purge along with
saving the query for subsequent use in the filter dialogue.
for incremental entry.
Because the Quartz Input Method module (imquartz.c) messes with the
selected text, so we cache it in the gnucash_sheet object and restore it
after the input module is done with the keypress.
And make the icon small to recover some vertical screen estate.
The motivation for this is that Gtk has dropped the ability for users
to change a toolbar's appearance. And as our icons are often less
than descriptive many users benefit from having textual descriptions
as well. This is the best compromise we can make until the gui
gets an in-depth redesign.