News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Some leaks in Pixelmap

Started by HSE, August 05, 2018, 10:25:12 AM

Previous topic - Next topic

HSE

Hi Biterider!

Fantastic Pixelmap  :t

In DrawStr there is a not working pushing nightmare. That must be:    invoke DrawTextEx, hTempDC, pText, -1, addr TextRect, dRenderFlags, NULL
    ;Release resources
    push hTempDC
    call SelectObject                             ;Unselect hTempDIBSect
   
    push hTempDC
    call SelectObject                             ;Unselect hFont

    push hTempDC
    call DeleteDC                                 ;Delete hTempDC

and in same method: invoke DeleteObject, hTempDIBSect             ;Delete hTempDIBSect

MethodEnd



Regards.

Equations in Assembly: SmplMath

Biterider

Hi HSE
I'll look into it as soon as I'm back from holidays (Spain)  :icon_cool:
Biterider

HSE

Equations in Assembly: SmplMath

avcaballero

I imagine that your like is the beach, although there are also many other lovely places to see. Though I suppose you are already better informed even than I could advise you. Enjoy it. :t

Biterider

#4
Thanks HSE  :icon14:
You are completely right. There is a bug while pushing the arguments when cleaning up the DrawStr method.

Attached the corrected OA32 Pixelmap version.

Biterider

HSE

Very close  :biggrin:

But you can't delete bits yet:
    ;Release resources
    push hTempDC
    call SelectObject                             ;Unselect hTempDIBSect & select prev DIBSect
    >>>>  invoke DeleteObject, eax                      ;Delete unselected hTempDIBSect
    push hTempDC
    call SelectObject                             ;Unselect hFont & select prev Font
    invoke DeleteDC, hTempDC                      ;Delete hTempDC



Just at the end:    invoke DeleteObject, hTempDIBSect             ;Delete hTempDIBSect

MethodEnd


An option is to move all that block to the end.
Equations in Assembly: SmplMath

Biterider

Ops, you are right (again)  :P
I moved the offending line to the end, were it should be!

As redress, I added the unicode version  ;)

Previous post updated.


Biterider

HSE

Equations in Assembly: SmplMath