diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2016-05-08 02:44:01 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2016-05-08 18:44:03 +0300 |
commit | cbaa25eb88a25852791d4f8b18fb9e9137fea401 (patch) | |
tree | 6c11d0aa36ac2f7aac07868262d38964237d0c10 /intern/cycles/render/tables.h | |
parent | 6100c2d262c58c611ccc75a20cca23bf9f245767 (diff) |
Cycles: Fix two small memory leaks and deduplicate table freeing
This commit makes remove_table skip the freeing if the offset is
already set to invalid - or, if it wasn't, set it to invalid after freeing.
That's what the current code was already doing in the Manager classes,
this change allows them to just call remove without the additional code.
Also, two potential memory leaks where new tables were always allocated
without freeing the old ones are fixed.
Reviewers: sergey, dingto, brecht
Differential Revision: https://developer.blender.org/D1974
Diffstat (limited to 'intern/cycles/render/tables.h')
-rw-r--r-- | intern/cycles/render/tables.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/render/tables.h b/intern/cycles/render/tables.h index 4efa09fa3c1..1bb70b22762 100644 --- a/intern/cycles/render/tables.h +++ b/intern/cycles/render/tables.h @@ -45,7 +45,7 @@ public: void device_free(Device *device, DeviceScene *dscene); size_t add_table(DeviceScene *dscene, vector<float>& data); - void remove_table(size_t offset); + void remove_table(size_t *offset); }; CCL_NAMESPACE_END |