mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
explicit cleanup of loaded model animations
in Application dtor
This commit is contained in:
parent
589077bce6
commit
cfbf8fdca7
2 changed files with 3 additions and 10 deletions
|
@ -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>();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue