diff --git a/.vscode/launch.json b/.vscode/launch.json index 96ca399..f99b0e7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,13 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "type": "gdb", + "request": "launch", + "name": "Debug (gdb)", + "program": "${workspaceFolder}/build/bin/editor", + "cwd": "${workspaceFolder}", + }, { "type": "lldb", "request": "launch", diff --git a/core/src/objects/datamodel.cpp b/core/src/objects/datamodel.cpp index 1a2f277..2cd6cd4 100644 --- a/core/src/objects/datamodel.cpp +++ b/core/src/objects/datamodel.cpp @@ -20,6 +20,12 @@ DataModel::DataModel() this->name = "Place"; } +DataModel::~DataModel() { +#ifndef NDEBUG + printf("Datamodel successfully destroyed\n"); +#endif +} + void DataModel::Init(bool runMode) { // Create default services GetService(); diff --git a/core/src/objects/datamodel.h b/core/src/objects/datamodel.h index a744772..2153eec 100644 --- a/core/src/objects/datamodel.h +++ b/core/src/objects/datamodel.h @@ -24,6 +24,7 @@ public: std::optional currentFile; DataModel(); + ~DataModel(); void Init(bool runMode = false); static inline std::shared_ptr New() { return std::make_shared(); }; diff --git a/core/src/panic.cpp b/core/src/panic.cpp index e0b1f9d..3a04cd6 100644 --- a/core/src/panic.cpp +++ b/core/src/panic.cpp @@ -1,13 +1,8 @@ #include "panic.h" -#include #include "logger.h" #include "platform.h" -#ifdef _NDEBUG -#define NDEBUG -#endif - bool trySafeAbort = false; void panic() { // We've already been here, safe aborting has failed. diff --git a/editor/mainwindow.cpp b/editor/mainwindow.cpp index 7609634..d7823f9 100644 --- a/editor/mainwindow.cpp +++ b/editor/mainwindow.cpp @@ -32,10 +32,6 @@ #include #include -#ifdef _NDEBUG -#define NDEBUG -#endif - bool worldSpaceTransforms = false; inline bool isDarkMode() { diff --git a/editor/mainwindow.ui b/editor/mainwindow.ui index b88327b..1f7293d 100644 --- a/editor/mainwindow.ui +++ b/editor/mainwindow.ui @@ -6,7 +6,7 @@ 0 0 - 1050 + 1100 750 diff --git a/editor/panes/explorermodel.cpp b/editor/panes/explorermodel.cpp index 538c20a..e9cdda3 100644 --- a/editor/panes/explorermodel.cpp +++ b/editor/panes/explorermodel.cpp @@ -8,10 +8,6 @@ #include #include -#ifdef _NDEBUG -#define NDEBUG -#endif - #define M_mainWindow dynamic_cast(dynamic_cast(dynamic_cast(this)->parent())->window()) // https://doc.qt.io/qt-6/qtwidgets-itemviews-simpletreemodel-example.html#testing-the-model diff --git a/editor/placedocument.cpp b/editor/placedocument.cpp index 6c3a29f..2d1660c 100644 --- a/editor/placedocument.cpp +++ b/editor/placedocument.cpp @@ -55,6 +55,9 @@ void PlaceDocument::setRunState(RunState newState) { } else if (newState == RUN_STOPPED) { _runState = RUN_STOPPED; +#ifndef NDEBUG + printf("DataModel stopped. Remaning use counts (should be 1): %ld\n", gDataModel.use_count()); +#endif // TODO: GC: Check to make sure gDataModel gets properly garbage collected prior to this gDataModel = editModeDataModel; updateSelectionListeners(gDataModel->GetService());