mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -110,6 +110,15 @@ struct transaction_s
|
||||
* any changes made if/when the edit is abandoned.
|
||||
*/
|
||||
Transaction *orig;
|
||||
|
||||
/* The readonly_reason is a string that indicates why a transaction
|
||||
* is marked as read-only. If NULL, the transaction is read-write.
|
||||
* This value is stored in kvp, but we cache a copy here for
|
||||
* performance reasons. reason_cache_valid indicates whether the
|
||||
* cached value is valid.
|
||||
*/
|
||||
char * readonly_reason;
|
||||
gboolean reason_cache_valid;
|
||||
};
|
||||
|
||||
struct _TransactionClass
|
||||
|
||||
Reference in New Issue
Block a user