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

Implement Exception Handling #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adham-elaraby
Copy link

This implements Exception Handling: by using try-catch blocks to handle exceptions that might occur during the execution of dwm-win32. This allows us to call unmanage() on all windows before crashing, and thus not losing any programs.

The __try block contains the main program code. If an unhandled exception occurs anywhere in this block, control immediately transfers to the __except block. The cleanupOnException function is then called to unmanage all windows before the program crashes.

This implements Exception Handling: by using try-catch blocks to handle exceptions that might occur during the execution of dwm-win32. This allows us to call `unmanage()` on all windows before crashing, and thus not losing any programs.

The `__try` block contains the main program code. If an unhandled exception occurs anywhere in this block, control immediately transfers to the `__except` block. The `cleanupOnException` function is then called to unmanage all windows before the program crashes.
@prabirshrestha
Copy link
Owner

Would be great if we could log the error to the windows log.

@prabirshrestha
Copy link
Owner

Researching a bit doesn't seem like there is a good way to log errors.

In the meantime can you try this #71? I'm wondering if the root cause of crashes is due to managing hanged or debugged windows.

I'm still open to this PR but wanted to make sure the other PR solves the issue first.

@adham-elaraby
Copy link
Author

Yes, I've also realized that when I looked online, not sure but will have to dig a bit deeper into the best approach to log the errors.

But that is not very relevant, as the changes in this PR don't seem to catch all the errors as I still experience some crashes that don't go through the except block, so there seems to be something else also causing crashes. For now I will try #71

(On a side note the main culprit for me that causes a crash without going through the try except seems to be Zoom, when entering/leaving breakout rooms and sharing presentations)

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.

2 participants