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

Save in main thread #45

Merged
merged 5 commits into from
Apr 26, 2018
Merged

Save in main thread #45

merged 5 commits into from
Apr 26, 2018

Conversation

andrast0th
Copy link

@andrast0th andrast0th commented Apr 25, 2018

doSave() method now locks the UI thread. Has a 10 second timeout.

This is needed for the save before close dialog to work.
If the save method would not block, the editor would close before save operation would finish


//This will stop the window from closing if an error occurs
//when saving from the dialog that appears when you close a dirty tab
monitor.setCanceled(true);

Choose a reason for hiding this comment

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

@atothhpe Looking at the code, it seems that doSave is only called twice and with null as a param.
monitor.setCanceled(true); will definitely throw an exception.
What will happen to "updateEntityJob.join(1000 * 10, monitor);" when monitor is null?

Copy link
Author

Choose a reason for hiding this comment

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

updateEntityJob.join(1000 * 10, monitor); can have a null monitor param

Copy link
Author

Choose a reason for hiding this comment

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

The monitor for the doSave is provided from the platfrom, sadly I have no idea where to get it from.
monitor.setCancelled is a problem, I need to find another way to keep the tab from closing on error

@andrast0th
Copy link
Author

@paul-ciobanu ok, I think i fixed it

@andrast0th andrast0th merged commit 7324c6a into master Apr 26, 2018
@andrast0th andrast0th deleted the save_in_main_thread branch April 26, 2018 13:43
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.

3 participants