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

Leaving Discord Messenger open for a while causes images and menu entries to stop being displayed #51

Closed
Zero3K opened this issue May 14, 2024 · 17 comments
Labels
bug Something isn't working

Comments

@Zero3K
Copy link

Zero3K commented May 14, 2024

image

@Zero3K Zero3K changed the title Leaving Discord Messenger open for a while causes images to stop being displayed Leaving Discord Messenger open for a while causes images and menu entries to stop being displayed May 14, 2024
@iProgramMC iProgramMC added the bug Something isn't working label May 15, 2024
@iProgramMC
Copy link
Contributor

Looks like bitmaps are being invalidated. The fix for now is to restart the app but this should really be fixed.

@Zero3K
Copy link
Author

Zero3K commented May 15, 2024

I wonder why the menu items are also not showing up when the bitmaps stop showing up.

@iProgramMC
Copy link
Contributor

What menu items?

@Zero3K
Copy link
Author

Zero3K commented May 15, 2024

All of them.

@iProgramMC
Copy link
Contributor

All of them is too vague. Show screenshots of exactly what you are talking about. What menu you are talking about, and what specific items.

@Zero3K
Copy link
Author

Zero3K commented May 15, 2024

I think it is a GDI Handle leak according to this:

image

That number keeps going up every few seconds.

Here's a more through look into what is leaking:

image

The number of Bitmaps is increasing.

@iProgramMC
Copy link
Contributor

Every few seconds is a bit strange.

Also, how many hours of browsing do you typically get before running into this issue?

@Zero3K
Copy link
Author

Zero3K commented May 15, 2024

I'll reply when it happens again with how long it took to happen.

@Zero3K
Copy link
Author

Zero3K commented May 15, 2024

It took around 2 hours and 40 minutes for it to happen. The GDI Handle count stopped being counted at 9,999.

@iProgramMC
Copy link
Contributor

I see.

@iProgramMC
Copy link
Contributor

Fixed in upstream. It turns out there is an issue with the guild list control. It didn't free the result to LoadBitmap().

@Zero3K
Copy link
Author

Zero3K commented May 17, 2024

There's still another leak that is happening.

@iProgramMC
Copy link
Contributor

As far as I know, I've fixed all known leaks. I've tried dragging the window continuously outside of the screen and it doesn't increase the GDI object/handle counter too much.

A tip I can give you to track down the leak is to open it up in Windows XP (or Windows 7 with the basic theme), drag a window over it and slowly reveal every control in the app. That's how I started noticing that the guild list is leaking GDI objects.

@Zero3K
Copy link
Author

Zero3K commented May 17, 2024

Then I wonder why the GDI Handles went up to 9,999 when I left it alone for a while.

@iProgramMC
Copy link
Contributor

I gave you a way to debug it.

@Zero3K
Copy link
Author

Zero3K commented May 17, 2024

I did that and see that the Bitmap number is still going up (but not as quickly).

@iProgramMC
Copy link
Contributor

iProgramMC commented May 17, 2024

OK, I've fixed another handle leak. It should be fine now!

It was due to leftover code that loaded some bitmaps uselessly everytime the member list was updated. Apparently LR_SHARED as parameter inside LoadImage only takes effect if the bitmap is of a standard size, which the status icons aren't. (They're 36x36)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants