Fix for AnimDebugDraw crash on shutdown.

This commit is contained in:
Anthony J. Thibault 2015-09-23 11:09:43 -07:00
parent a454584496
commit 90a551214e
3 changed files with 8 additions and 0 deletions

View file

@ -794,6 +794,8 @@ void Application::cleanupBeforeQuit() {
DependencyManager::get<EyeTracker>()->setEnabled(false, true);
#endif
AnimDebugDraw::getInstance().shutdown();
if (_keyboardFocusHighlightID > 0) {
getOverlays().deleteOverlay(_keyboardFocusHighlightID);
_keyboardFocusHighlightID = -1;

View file

@ -141,6 +141,10 @@ AnimDebugDraw::AnimDebugDraw() :
}
AnimDebugDraw::~AnimDebugDraw() {
}
void AnimDebugDraw::shutdown() {
// remove renderItem from main 3d scene.
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
if (scene && _itemID) {
render::PendingChanges pendingChanges;

View file

@ -27,6 +27,8 @@ public:
AnimDebugDraw();
~AnimDebugDraw();
void shutdown();
// draw a skeleton bind pose
void addSkeleton(const std::string& key, AnimSkeleton::ConstPointer skeleton, const AnimPose& rootPose, const glm::vec4& color);
void removeSkeleton(const std::string& key);