Fix premature deletion of dependencies (#5952)

In particular, the object repository can potentially be deleted before the object manager is deleted. This causes a crash when the object manager is deleted because it requires the object repository within the destructor.
This commit is contained in:
Ted John authored and GitHub committed 2017-07-20 17:44:31 +01:00
1 parent 260f342d73
commit 2eb9657781
5 files changed
+29 -16

No files matched your search

+4 -4
View File
@@ -456,17 +456,17 @@ public:
}
};
static std::unique_ptr<TrackDesignRepository> _trackDesignRepository;
static TrackDesignRepository * _trackDesignRepository = nullptr;
ITrackDesignRepository * CreateTrackDesignRepository(IPlatformEnvironment * env)
{
_trackDesignRepository = std::unique_ptr<TrackDesignRepository>(new TrackDesignRepository(env));
return _trackDesignRepository.get();
_trackDesignRepository = new TrackDesignRepository(env);
return _trackDesignRepository;
}
ITrackDesignRepository * GetTrackDesignRepository()
{
return _trackDesignRepository.get();
return _trackDesignRepository;
}
extern "C"