#20 Fix for GDI leak while in a call, causing lots of crashes

open
nobody
None
5
2008-08-11
2008-08-11
Axel Siebert
No

CVideoOutputDevice::SetFrameSize retrieves a window DC every time a video frame is drawn, but it never releases it. This causes a massive GDI leak and very frequent crashes because of hitting the limit of available GDI handles. The following code has to be added in that function, right after "PWaitAndSignal wait(mutex);":

if (m_wndFrame)
m_wndFrame->ReleaseDC(curDC);

As this project doesn't seem to be maintained anymore and compiling it yourself is not that easy, I have prepared a binary patch for MyPhone version 0.2b12.

First, you have to unpack myphone.exe using http://upx.sourceforge.net/ :
"upx -d myphone.exe"

Then grab a hex editor and change/add the following bytes in myphone.exe:

Offset 230:
96 -> E4

Offset 280:
10 -> 14

Offset 57FA:
8B 86 08 01 00 00 -> E8 97 A3 2A 00 90

New bytes at offset 2AFB96:
8B 8E 8C 00 00 00 85 C9 74 33 8B 86 E8 00 00 00 FF 70 04 FF 71 20 A1 10 BF 78 00 85 C0 75 1C 68 DA B7 74 00 FF 15 C0 00 6B 00 68 DA FB 6A 00 50 FF 15 F8 00 6B 00 A3 10 BF 78 00 FF D0 8B 86 08 01 00 00 C3 52 65 6C 65 61 73 65 44 43 00

Discussion