misc(misc): debugging stuff
This commit is contained in:
parent
cba770c4af
commit
497cbc51e0
8 changed files with 18 additions and 14 deletions
7
.vscode/launch.json
vendored
7
.vscode/launch.json
vendored
|
@ -4,6 +4,13 @@
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "gdb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Debug (gdb)",
|
||||||
|
"program": "${workspaceFolder}/build/bin/editor",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "lldb",
|
"type": "lldb",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
|
|
@ -20,6 +20,12 @@ DataModel::DataModel()
|
||||||
this->name = "Place";
|
this->name = "Place";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DataModel::~DataModel() {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
printf("Datamodel successfully destroyed\n");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void DataModel::Init(bool runMode) {
|
void DataModel::Init(bool runMode) {
|
||||||
// Create default services
|
// Create default services
|
||||||
GetService<Workspace>();
|
GetService<Workspace>();
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
std::optional<std::string> currentFile;
|
std::optional<std::string> currentFile;
|
||||||
|
|
||||||
DataModel();
|
DataModel();
|
||||||
|
~DataModel();
|
||||||
void Init(bool runMode = false);
|
void Init(bool runMode = false);
|
||||||
|
|
||||||
static inline std::shared_ptr<DataModel> New() { return std::make_shared<DataModel>(); };
|
static inline std::shared_ptr<DataModel> New() { return std::make_shared<DataModel>(); };
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
#include "panic.h"
|
#include "panic.h"
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#ifdef _NDEBUG
|
|
||||||
#define NDEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool trySafeAbort = false;
|
bool trySafeAbort = false;
|
||||||
void panic() {
|
void panic() {
|
||||||
// We've already been here, safe aborting has failed.
|
// We've already been here, safe aborting has failed.
|
||||||
|
|
|
@ -32,10 +32,6 @@
|
||||||
#include <qtoolbutton.h>
|
#include <qtoolbutton.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef _NDEBUG
|
|
||||||
#define NDEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool worldSpaceTransforms = false;
|
bool worldSpaceTransforms = false;
|
||||||
|
|
||||||
inline bool isDarkMode() {
|
inline bool isDarkMode() {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1050</width>
|
<width>1100</width>
|
||||||
<height>750</height>
|
<height>750</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -8,10 +8,6 @@
|
||||||
#include <qmimedata.h>
|
#include <qmimedata.h>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#ifdef _NDEBUG
|
|
||||||
#define NDEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define M_mainWindow dynamic_cast<MainWindow*>(dynamic_cast<QWidget*>(dynamic_cast<QObject*>(this)->parent())->window())
|
#define M_mainWindow dynamic_cast<MainWindow*>(dynamic_cast<QWidget*>(dynamic_cast<QObject*>(this)->parent())->window())
|
||||||
|
|
||||||
// https://doc.qt.io/qt-6/qtwidgets-itemviews-simpletreemodel-example.html#testing-the-model
|
// https://doc.qt.io/qt-6/qtwidgets-itemviews-simpletreemodel-example.html#testing-the-model
|
||||||
|
|
|
@ -55,6 +55,9 @@ void PlaceDocument::setRunState(RunState newState) {
|
||||||
} else if (newState == RUN_STOPPED) {
|
} else if (newState == RUN_STOPPED) {
|
||||||
_runState = 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
|
// TODO: GC: Check to make sure gDataModel gets properly garbage collected prior to this
|
||||||
gDataModel = editModeDataModel;
|
gDataModel = editModeDataModel;
|
||||||
updateSelectionListeners(gDataModel->GetService<Selection>());
|
updateSelectionListeners(gDataModel->GetService<Selection>());
|
||||||
|
|
Loading…
Add table
Reference in a new issue