[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53546] trunk/blender/source/blender/ editors/sculpt_paint: fix occasional memory leak in projection paint - multiple threads could initialize the brush curve at once .

Campbell Barton ideasman42 at gmail.com
Fri Jan 4 04:07:31 CET 2013


Revision: 53546
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53546
Author:   campbellbarton
Date:     2013-01-04 03:07:25 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
fix occasional memory leak in projection paint - multiple threads could initialize the brush curve at once.
also some header cleanup.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2013-01-04 02:54:38 UTC (rev 53545)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2013-01-04 03:07:25 UTC (rev 53546)
@@ -42,7 +42,6 @@
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
 #include "BLI_linklist.h"
 #include "BLI_memarena.h"
 #include "BLI_threads.h"
@@ -54,13 +53,9 @@
 #include "IMB_imbuf_types.h"
 
 #include "DNA_brush_types.h"
-#include "DNA_camera_types.h"
 #include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
 
 #include "BKE_camera.h"
 #include "BKE_context.h"
@@ -77,8 +72,7 @@
 #include "BKE_paint.h"
 #include "BKE_report.h"
 #include "BKE_scene.h"
-#include "BKE_global.h"
-#include "BKE_deform.h"
+#include "BKE_colortools.h"
 
 #include "BKE_tessmesh.h"
 
@@ -102,7 +96,6 @@
 #include "RNA_enum_types.h"
 
 #include "GPU_draw.h"
-#include "GPU_extensions.h"
 
 #include "IMB_colormanagement.h"
 
@@ -5149,6 +5142,9 @@
 		/* initialize all data from the context */
 		project_state_init(C, OBACT, &pop->ps);
 
+		/* needed so multiple threads don't try to initialize the brush at once (can leak memory) */
+		curvemapping_initialize(pop->ps.brush->curve);
+
 		paint_brush_init_tex(pop->ps.brush);
 
 		pop->ps.source = PROJ_SRC_VIEW;

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-01-04 02:54:38 UTC (rev 53545)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_2d.c	2013-01-04 03:07:25 UTC (rev 53546)
@@ -37,7 +37,6 @@
 #include "DNA_scene_types.h"
 
 #include "BKE_brush.h"
-#include "BKE_texture.h"
 
 #include "BLI_math.h"
 




More information about the Bf-blender-cvs mailing list