Skip to content

Commit

Permalink
Merge pull request #37 from captainssounds/bug/dbug-3rdparty-crash
Browse files Browse the repository at this point in the history
Bug/dbug 3rdparty crash
  • Loading branch information
mikeallisonJS authored Aug 30, 2020
2 parents 5aec520 + 2d4c642 commit 22cd09d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.0.7
- Fix Dbug crashes on 3rd party non-CSModule modules

### 1.0.6
- Cleaned up Dbug output
- Fixed Several Dbug crash scenarios (core modules still causing issues)
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"slug": "CaptainsSounds",
"name": "Captain's Sounds",
"version": "1.0.6",
"version": "1.0.7",
"license": "GPL-3.0-only",
"brand": "Captain's Sounds",
"author": "Mike Allison",
Expand Down
6 changes: 4 additions & 2 deletions src/DBug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ bool DBugDisplay::isConnected() {

bool DBugDisplay::isSafe() {
// TODO: Better bad parent module testing. Sadly, model pointer slug & id do not dereference properly
// At least test that dbug isn't being nested
return module->leftExpander.module->model != modelDBug;
auto leftExpanderModule = module->leftExpander.module;
bool notNested = leftExpanderModule->model != modelDBug;
bool isDBugable = dynamic_cast<CSModule*>(leftExpanderModule) != nullptr;
return notNested && isDBugable;
}

Model* modelDBug = createModel<DBug, DBugWidget>("DBug");

0 comments on commit 22cd09d

Please sign in to comment.