Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2015-02-09 14:02:59 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2015-02-09 14:02:59 +0300
commit5544ded2b513a41caa1673aea3dfbbc5b56380be (patch)
treeb4ad7ff0afd0de0e79af357d492c0cd42c543673 /source/blender/blenkernel/intern/image.c
parent567e147f619b1a51eecebccaaff39030362fd2f4 (diff)
Fix ImBuf leaked by Image from View operator
Running this operator and and closing Blender gives this: Error: Not freed memory blocks: 2 ImBuf_struct len: 2480 0x69ba4f8 imb_addrectImBuf len: 1048576 0x6ccc2d8 Fixed with added call to IMB_freeImBuf in BKE_image_add_from_imbuf. Could be fixed in the operator instead, but I think the BKE function is the correct place since the comment says it should take ownership of the ImBuf. Reviewers: sergey Reviewed By: sergey Differential Revision: https://developer.blender.org/D1084
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 748d0d10d4a..131a19b8108 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -803,7 +803,9 @@ Image *BKE_image_add_generated(Main *bmain, unsigned int width, unsigned int hei
return ima;
}
-/* creates an image image owns the imbuf passed */
+/* Create an image image from ibuf. The refcount of ibuf is increased,
+ * caller should take care to drop its reference by calling
+ * IMB_freeImBuf if needed. */
Image *BKE_image_add_from_imbuf(ImBuf *ibuf)
{
/* on save, type is changed to FILE in editsima.c */