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:
authorCampbell Barton <ideasman42@gmail.com>2011-07-10 22:54:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-10 22:54:02 +0400
commit80eb1eae42940664452d7d4ec94a6a383a8c1e9d (patch)
tree04d92a0523f8eb7e4a2994c53c42cf401003782c /source/creator
parent1f6a79ecb59e958385544270c6226f6419c12ecd (diff)
run WM_exit(C) when blender as a python module exits
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/creator.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index a8b24d0c9bc..fddd6d286db 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1134,7 +1134,8 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
#ifdef WITH_PYTHON_MODULE
/* allow python module to call main */
-#define main main_python
+#define main main_python_enter
+static void *evil_C= NULL;
#endif
int main(int argc, const char **argv)
@@ -1145,6 +1146,7 @@ int main(int argc, const char **argv)
#ifdef WITH_PYTHON_MODULE
#undef main
+ evil_C= C;
#endif
#ifdef WITH_BINRELOC
@@ -1313,6 +1315,14 @@ int main(int argc, const char **argv)
return 0;
} /* end of int main(argc,argv) */
+#ifdef WITH_PYTHON_MODULE
+void main_python_exit(void)
+{
+ WM_exit((bContext *)evil_C);
+ evil_C= NULL;
+}
+#endif
+
static void error_cb(const char *err)
{