explicit cleanup of loaded model animations

in Application dtor
This commit is contained in:
Andrew Meadows 2015-02-13 16:19:10 -08:00
parent 589077bce6
commit cfbf8fdca7
2 changed files with 3 additions and 10 deletions

View file

@ -65,6 +65,7 @@
#include <HFBackEvent.h>
#include <LogHandler.h>
#include <MainWindow.h>
#include <ModelEntityItem.h>
#include <NetworkAccessManager.h>
#include <OctalCode.h>
#include <OctreeSceneStats.h>
@ -565,6 +566,8 @@ Application::~Application() {
Menu::getInstance()->deleteLater();
_myAvatar = NULL;
ModelEntityItem::cleanupLoadedAnimations() ;
DependencyManager::destroy<GLCanvas>();
DependencyManager::destroy<AnimationCache>();

View file

@ -163,16 +163,6 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
QMap<QString, AnimationPointer> ModelEntityItem::_loadedAnimations; // TODO: improve cleanup by leveraging the AnimationPointer(s)
// This class/instance will cleanup the animations once unloaded.
class EntityAnimationsBookkeeper {
public:
~EntityAnimationsBookkeeper() {
ModelEntityItem::cleanupLoadedAnimations();
}
};
EntityAnimationsBookkeeper modelAnimationsBookkeeperInstance;
void ModelEntityItem::cleanupLoadedAnimations() {
foreach(AnimationPointer animation, _loadedAnimations) {
animation.clear();