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>2007-02-28 02:54:55 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2007-02-28 02:54:55 +0300
commit04337d4ada75938dd7e9954efbe18c5d854810bb (patch)
tree06b168ca075ef317135c442b45bf7904a3f5110a /source/blender/src/sculptmode.c
parent4f9cb4c7106f05bd62b9f74fce3c3653262c76c4 (diff)
== Sculpt Mode ==
Added a SculptSession parameter to sculptmode_propset_end, to avoid propset_end creating a new session (propset_end is called when freeing the session, so this can cause a memory leak.)
Diffstat (limited to 'source/blender/src/sculptmode.c')
-rw-r--r--source/blender/src/sculptmode.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c
index cc3c9a64316..53ac5467445 100644
--- a/source/blender/src/sculptmode.c
+++ b/source/blender/src/sculptmode.c
@@ -230,7 +230,7 @@ void sculptmode_free_vertexusers(SculptSession *ss)
}
}
-void sculptmode_propset_end(int);
+void sculptmode_propset_end(SculptSession *ss, int);
void sculptmode_free_session(Scene *sce)
{
SculptSession *ss= sce->sculptdata.session;
@@ -238,7 +238,7 @@ void sculptmode_free_session(Scene *sce)
sculptmode_free_vertexusers(ss);
if(ss->texcache)
MEM_freeN(ss->texcache);
- sculptmode_propset_end(1);
+ sculptmode_propset_end(ss, 1);
MEM_freeN(ss);
sce->sculptdata.session= NULL;
}
@@ -1222,11 +1222,11 @@ void sculptmode_propset_header()
}
}
-void sculptmode_propset_end(int cancel)
+void sculptmode_propset_end(SculptSession *ss, int cancel)
{
- SculptSession *ss= sculpt_session();
- PropsetData *pd= ss ? ss->propset : NULL;
- if(pd) {
+ if(ss && ss->propset) {
+ PropsetData *pd= ss->propset;
+
if(cancel) {
sculptmode_brush()->size= pd->origsize;
sculptmode_brush()->strength= pd->origstrength;
@@ -1366,7 +1366,7 @@ void sculptmode_propset(unsigned short event)
while(get_mbut()==L_MOUSE);
case RETKEY:
case PADENTER:
- sculptmode_propset_end(0);
+ sculptmode_propset_end(sculpt_session(), 0);
break;
default:
break;