mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +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 <HFBackEvent.h>
|
||||||
#include <LogHandler.h>
|
#include <LogHandler.h>
|
||||||
#include <MainWindow.h>
|
#include <MainWindow.h>
|
||||||
|
#include <ModelEntityItem.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <OctalCode.h>
|
#include <OctalCode.h>
|
||||||
#include <OctreeSceneStats.h>
|
#include <OctreeSceneStats.h>
|
||||||
|
@ -565,6 +566,8 @@ Application::~Application() {
|
||||||
Menu::getInstance()->deleteLater();
|
Menu::getInstance()->deleteLater();
|
||||||
|
|
||||||
_myAvatar = NULL;
|
_myAvatar = NULL;
|
||||||
|
|
||||||
|
ModelEntityItem::cleanupLoadedAnimations() ;
|
||||||
|
|
||||||
DependencyManager::destroy<GLCanvas>();
|
DependencyManager::destroy<GLCanvas>();
|
||||||
DependencyManager::destroy<AnimationCache>();
|
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)
|
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() {
|
void ModelEntityItem::cleanupLoadedAnimations() {
|
||||||
foreach(AnimationPointer animation, _loadedAnimations) {
|
foreach(AnimationPointer animation, _loadedAnimations) {
|
||||||
animation.clear();
|
animation.clear();
|
||||||
|
|
Loading…
Reference in a new issue