[Bf-blender-cvs] [0271414] master: Fix T46109: Bitmap font objects leads to unfreed memory.

Bastien Montagne noreply at git.blender.org
Mon Sep 14 17:13:03 CEST 2015


Commit: 0271414aadfba6162456f0c5493529e64c3b32a4
Author: Bastien Montagne
Date:   Mon Sep 14 17:12:40 2015 +0200
Branches: master
https://developer.blender.org/rB0271414aadfba6162456f0c5493529e64c3b32a4

Fix T46109: Bitmap font objects leads to unfreed memory.

===================================================================

M	source/blender/imbuf/intern/allocimbuf.c

===================================================================

diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index b8771e3..5c79eb2 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -128,6 +128,13 @@ void imb_freetilesImBuf(ImBuf *ibuf)
 	ibuf->mall &= ~IB_tiles;
 }
 
+static void imb_free_bitmap_font(ImBuf *ibuf)
+{
+	if (ibuf->userdata && (ibuf->userflags & IB_BITMAPFONT)) {
+		MEM_freeN(ibuf->userdata);
+	}
+}
+
 static void freeencodedbufferImBuf(ImBuf *ibuf)
 {
 	if (ibuf == NULL) return;
@@ -181,6 +188,7 @@ void IMB_freeImBuf(ImBuf *ibuf)
 			imb_freerectImBuf(ibuf);
 			imb_freerectfloatImBuf(ibuf);
 			imb_freetilesImBuf(ibuf);
+			imb_free_bitmap_font(ibuf);
 			IMB_freezbufImBuf(ibuf);
 			IMB_freezbuffloatImBuf(ibuf);
 			freeencodedbufferImBuf(ibuf);




More information about the Bf-blender-cvs mailing list