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:
authorJoseph Eagar <joeedh@gmail.com>2007-07-27 10:14:25 +0400
committerJoseph Eagar <joeedh@gmail.com>2007-07-27 10:14:25 +0400
commit3031f1f2bd13d0265e3214bf9f17a8bdd1b1dc2f (patch)
tree9a115cd7208a560949d600cb4cc38139d69df140 /source/blender/src/drawscript.c
parentc540888f727f4a7ae703c1e07da85c620a2b656c (diff)
=Draw Module Fixed=
This commit fixes the Draw module. All buttons/widgets created via the Draw module in a SpaceScript area are now inserted into a global list attached to the SpaceScript data. This list is cleared before each draw, when freeing the space, and when the area is switched to another space.c This is necessary to prevent Blender's internal UI code from getting invalid pointers to python data. In addition, it allows storing widget tooltips inside the python Button objects, which solves that little bit of stupidity. Note that this reverts the previous weaklist solution. In fact, I had to go over each previous commit by Campbell after this code originally branched before the weaklist commit and re-add each commit. So if anything is missing, just tell me, or feel free to re-add it.
Diffstat (limited to 'source/blender/src/drawscript.c')
-rw-r--r--source/blender/src/drawscript.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/src/drawscript.c b/source/blender/src/drawscript.c
index 024d83950ad..b009c3b8388 100644
--- a/source/blender/src/drawscript.c
+++ b/source/blender/src/drawscript.c
@@ -142,6 +142,12 @@ void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *
void free_scriptspace (SpaceScript *sc)
{
if (!sc) return;
-
+
+ /*free buttons references*/
+ if (sc->but_refs) {
+ BPy_Set_DrawButtonsList(sc->but_refs);
+ BPy_Free_DrawButtonsList();
+ sc->but_refs = NULL;
+ }
sc->script = NULL;
}