Skip to content

Fix userwindows not going away on profile close#2959

Merged
vadi2 merged 1 commit intoMudlet:developmentfrom
vadi2:fix-userwindow-crash
Aug 11, 2019
Merged

Fix userwindows not going away on profile close#2959
vadi2 merged 1 commit intoMudlet:developmentfrom
vadi2:fix-userwindow-crash

Conversation

@vadi2
Copy link
Copy Markdown
Member

@vadi2 vadi2 commented Aug 8, 2019

Brief overview of PR changes/additions

Fix userwindows not going away on profile close - the console they were belonging to was getting removed, but not the dock widget the console was in.

Motivation for adding to Mudlet

Bugfix.

Other info (issues closed, discussion etc)

Fix #2916.

@vadi2 vadi2 added this to the 4.1.0 milestone Aug 8, 2019
@vadi2 vadi2 requested a review from a team as a code owner August 8, 2019 17:52
@vadi2 vadi2 requested a review from a team August 8, 2019 17:52
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Aug 8, 2019

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

Copy link
Copy Markdown
Contributor

@Kebap Kebap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the crash!

auto hostName(pHost->getName());
auto pC = pHost->mpConsole->mSubConsoleMap.value(name);
auto pD = pHost->mpConsole->mDockWidgetMap.value(name);
auto console = pHost->mpConsole->mSubConsoleMap.value(name);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I make the observations that:

  • the loss of the initial p is disguising (as far as I am concerned) that this and the next variable are pointers
  • the noise from the variable renaming is hiding any changes in the functionality - hell, it isn't even obvious that anything has changed in this method...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid points, but - a good Git client shows that only the variable was renamed in every line. Github's doesn't unfortunately, and if you confuse that the value is not a pointer, the compiler will tell you very fast otherwise, so no mistake can be made there.

connect(dactionShowMap, &QAction::triggered, this, &mudlet::slot_mapper);
connect(dactionOptions, &QAction::triggered, this, &mudlet::slot_show_options_dialog);
connect(dactionAbout, &QAction::triggered, this, &mudlet::slot_show_about_dialog);
// PLACEMARKER: Save for later restoration (2 of 2) (by adding a "Close" (profile) option to first menu on menu bar:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎 I do want to put that close option (back?) in - IMHO it logically make sense, though it will need some checking that the Application does return to the state prior to the initial "Connect Dialog" appearance on start-up. Remember when running a single profile there is not method currently to close the profile without terminating the application (perhaps we might want to use <CTRL>+<F4>) even though that is not an unreasonable way of operating.

OTOH for consistency I do not see you deleting the other // PLACEMARKER: Save for later restoration... for this, even though I made it clear that there is two of them! 😮

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be re-added when needed later on, it's always available in Git history!

dockWindowMap.remove(consoleName);
}

hostConsoleMap[consoleName]->close();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely calling QDockWidget::close() when the Qt::WA_DeleteOnClose property is set on it will automagically destroy the TConsole instance it contains {and if not, why not?} - so shouldn't the hostConsoleMap[consoleName]->close(); be in an else to the if - though the hostConsoleMap.remove(consoleName); should remain outside of the if ? 🤓

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire reason for this bug is because the TConsole is not destroyed automatically when the QDockWidget is, so this solution works well.

@vadi2 vadi2 merged commit 865cc18 into Mudlet:development Aug 11, 2019
@vadi2 vadi2 deleted the fix-userwindow-crash branch August 11, 2019 14:59
vadi2 added a commit to dicene/Mudlet that referenced this pull request Aug 13, 2019
vadi2 pushed a commit that referenced this pull request Aug 20, 2019
* Initial commit. Adds ctrl+tab shortcut and logic for moving from pane to pane in the trigger editor.

* Shortcut works without menu action. Forward tabbing logic seems to be right.

Just missing reverse shortcut and logic.

* Added CTRL+SHIFT+Tab shortcut to tab through sections in reverse order.

* Removed unnecessary debug code.

* Factor out drawing exits in the map into a separate method (#2941)

* WIP

* Const the variables that we can

* Format

* Reorganize windows sdk (#2958)

* Move declaration of install functions

This allows us to use them singularly in a different context.

* Use our own edbee with updated QsLog (#2914)

Intention is to send all improvements upstream but not be delayed by them getting merged.

* Fix userwindows not going away on profile close (#2959)

* Use correct URL to download the coverity software

* Don't show SSL certificate info until we have one in Profile Preferences (#2953)

* Don't show SSL certificate info until we have one & streamline UI

* Remove colorroles

* Add a workaround for mapper creation breaking getMainWindowSize() (#2945)

* Add a workaround for mapper creation breaking getMainWindowSize()

* Revert "Fix errors when creating new triggers (#2868)"

This reverts commit 0578c61.

* Fix typo

* Don't include TLS code code when it's not available (#2965)

* Raise minimum to Qt 5.11 (#2944)

* Raise minimum to Qt 5.11

* Update Travis minimum Qt build

* Remove < Qt 5.11 workarounds (#2969)

* Replace a couple of cases of std::tie with auto (#2967)

* Replace a couple of cases of std::tie with auto

* A few more

* Fix Coverity TTimer mRepeating initialiser warning (#2972)

* Fix updateDialog uninitialised in constructor (#2973)

* Fix nullptr warning around curVar (#2974)

* Fix a possible nullptr dereference if the room wasn't found for some reason (#2975)

* getRoom() will return nullptr if the room id is negative (#2976)

* Add autocomplete toggle (#2679)

* Update tooltip, more than IRE now provide maps (#2668)

* Add autocomplete toggle to profile

* Update to a version of edbee with autocomplete toggle

* Wire in the autocomplete toggle

* Use correct host variable

* Add missing toggle call

* Formatting changes up simplification of some code.

* Added closing bracket that I must have accidentally deleted while resolving conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash closing left-over userWindow

3 participants