Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
5261e209
Commit
5261e209
authored
11 years ago
by
Studer Gabriel
Committed by
Gabriel Studer
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix another segfault on exit
parent
2883114c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gfx/pymod/export_scene.cc
+15
-0
15 additions, 0 deletions
modules/gfx/pymod/export_scene.cc
with
15 additions
and
0 deletions
modules/gfx/pymod/export_scene.cc
+
15
−
0
View file @
5261e209
...
...
@@ -87,6 +87,9 @@ void scene_set_hemi_p(Scene* s, tuple p)
}
// anon ns
void
clear_scene
()
{
Scene
::
Instance
().
RemoveAll
();
}
void
export_Scene
()
{
...
...
@@ -264,4 +267,16 @@ void export_Scene()
.
add_property
(
"show_export_aspect"
,
&
Scene
::
GetShowExportAspect
,
&
Scene
::
SetShowExportAspect
)
.
add_property
(
"hemi_params"
,
scene_get_hemi_p
,
scene_set_hemi_p
)
;
// we need to make sure there are no pending references to Python objects
// tied to the scene singleton. The destructor of
// scene may be called after Python is shutdown which results
// in a segfault.
scope
().
attr
(
"__dict__"
)[
"atexit"
]
=
handle
<>
(
PyImport_ImportModule
(
"atexit"
));
def
(
"_clear_scene"
,
&
clear_scene
);
object
r
=
scope
().
attr
(
"_clear_scene"
);
scope
().
attr
(
"atexit"
).
attr
(
"register"
)(
r
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment