Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog gets stuck if a traceback occurs during it's creation. #184

Merged
merged 3 commits into from Feb 9, 2017

Conversation

kdschlosser
Copy link
Member

if a traceback occurs during the creation of a dialog. a notification was already sent out to add the dialog to mainframes openDialogs. the FinishSetup method in TaskletDialog never gets to run there for never setting the setupFinished flag. so when the exception gets caught and printed and should happen along it's merry way there is some checking of the setupFinished and the destruction on the dialog only occurs when setupFinished is set to True. so a notification never gets sent to remove the dialog from the list. causing the "phantom dialog" effect. forcing you to kill the EventGhost process because the main frame thinks there is still an open dialog.

Upon fixing this issue I happened upon 2 others caused by thread timing. The 2 things that were happening in 2 different threads are the selecting of the treeItem and the deleting of the treeItem. so what would happen is in the middle of the treeItem being selected it would get deleted. causing additional tracebacks.. which should not have happened. those are fixed as well..

If a traceback occurs during the creation of the dialog the FinishSetup never gets to run there for is unable to set the flag setupFinished. even tho a notification has already been sent out and the dialog has been added to the openDialogs list in the mainFrame. So what I have done is removed the checking of setupFinished in the TaskletDialog.ProcessingTask this will allow for the dialog to be destroyed and the notification to be sent to remove the dialog. wether or not the the dialog finished setup.
If a dialog has a traceback  that occurs during the creation of the dialog. there is a timing issue in the threads that causes extra tracebacks to occur.

this is the setup..

tree Item gets selected. causing a eg.Notify routine to run. the dialog gets created. traceback occurs. then the dialog gets destroyed. sending another Notification to remove the dialog from this list. and the treeItem gets deleted in a seperate thread somewhere along these lines it causes the item.parent in tree Item to become None because it was deleted.. because there are 2 threads running one that deleted the item and the other that is still working on selecting the item the one that is selecting the item duns across NoneType errors. 
so these 2 changes account for that possibility and will remove the additional tracebacks that really do not need to be shown when an item gets deleted due to a traceback from a dialog.
Copy link
Contributor

@ThomasBott ThomasBott left a comment

Choose a reason for hiding this comment

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

Works very good, I didn't find any issues while testing

@@ -162,10 +162,10 @@ def ProcessingTask(self, *args, **kwargs):
self.Configure(*args, **kwargs)
except:
eg.PrintTraceback()

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you add this line on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

did i add what on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

if you mean the blank line.... if there was a "blank line" there before and it had been tabbed out.. my IDE will remove any unneeded white space so it will look like an addition..

If memory serves in this case i was modifying the code right in that area so it is possible i added something then deleted it and didn't remove the empty line.. Let me go back and look at the code..

Removes blank line that was accidentally added
@topic2k topic2k added the bug label Feb 9, 2017
@topic2k topic2k changed the title [EventGhost] - Bugfix - Dialog gets stuck if a traceback occurs during it's creation. Dialog gets stuck if a traceback occurs during it's creation. Feb 9, 2017
@topic2k topic2k merged commit 6eaec5e into EventGhost:master Feb 9, 2017
@topic2k topic2k added bugfix and removed bug labels Feb 10, 2017
@kdschlosser kdschlosser deleted the bugfix-lostdialog branch February 26, 2017 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants