Use smart pointer
This commit is contained in:
@@ -259,8 +259,8 @@ void FEngine::init() {
|
||||
SYSTRACE_CALL();
|
||||
|
||||
#if FILAMENT_ENABLE_FGDBG
|
||||
if (!debug.fgdbg) {
|
||||
debug.fgdbg = new fgdbg::DebugServer();
|
||||
if (!debug.fgdbg) {
|
||||
debug.fgdbg = std::make_unique<fgdbg::DebugServer>();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -402,10 +402,6 @@ void FEngine::shutdown() {
|
||||
ASSERT_PRECONDITION(ThreadUtils::isThisThread(mMainThreadId),
|
||||
"Engine::shutdown() called from the wrong thread!");
|
||||
|
||||
#if FILAMENT_ENABLE_FGDBG
|
||||
delete debug.fgdbg;
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
// print out some statistics about this run
|
||||
size_t wm = mCommandBufferQueue.getHighWatermark();
|
||||
|
||||
@@ -528,7 +528,7 @@ public:
|
||||
bool doFrameCapture = false;
|
||||
} renderer;
|
||||
matdbg::DebugServer* server = nullptr;
|
||||
fgdbg::DebugServer* fgdbg = nullptr;
|
||||
std::unique_ptr<fgdbg::DebugServer> fgdbg = nullptr;
|
||||
} debug;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user