Fix memory leak in xaccTransGetReadOnly

In addition implement a cache for this value as suggested in the comments
as this function is called on every transaction commit.
This commit is contained in:
Geert Janssens
2018-09-09 22:49:52 +02:00
parent 3634e8f59d
commit d069b67d48
5 changed files with 48 additions and 16 deletions

View File

@@ -423,7 +423,7 @@ void xaccTransClearReadOnly (Transaction *trans);
/** Returns a non-NULL value if this Transaction was marked as read-only with
* some specific "reason" text. */
const char * xaccTransGetReadOnly (const Transaction *trans);
const char * xaccTransGetReadOnly (Transaction *trans);
/** Returns TRUE if this Transaction is read-only because its posted-date is
* older than the "auto-readonly" threshold of this book. See