logo       
Google Custom Search
    AddThis Social Bookmark Button

DESTROYing Wx::Bitmap: msg#00122

Subject: DESTROYing Wx::Bitmap
Hello,

A few months ago I mentioned that my application (pVoice) crashed at
shutdown. After some fooling around I found (at that time) that the
error occurred at the line in Bitmap.XS where (within the DESTROY sub)
it says 'delete THIS'.
At that time (with wxPerl 0.15) removing that line seemed to 'solve' the
problem (which of course, as Mattia mentioned) it didn't, but it just
hid the error, probably causing more problems in the long run.

I just installed a new PC, started with ActivePerl 5.8.2 (instead of
5.6.1 which I used when I first worked on the problem), downloaded and
compiled wxWindows 2.4.2 with Unicode and MSLU, downloaded, modified (in
the same way as described above) and compiled wxPerl 0.18, and now my
'solution' indeed causes a lot of problems, more specifically it has
unpredictable effects on repainting the screen (some parts aren't
updated, others are), but the crashing still doesn't happen :). No need
to say that this is worse than an error when you shut down your
application.

However, I continued debugging, tried all kinds of things in the
Wx::Bitmap::DESTROY XS subroutine (using code from other classes'
DESTROY subroutines), but to no avail.

Finally I re-read the documentation on wxBitmap, more specifically the
part where it describes the destructor. There it says you shouldn't
destroy a Bitmap that is used in a Memory Device Context. This may be
the source of my problem. All of my Wx::Bitmap-s are used within a
Memory Device Context!

Now the question arises: How can I prevent these bitmaps to be destroyed
if they're used within a Memory Device context??
Is it possible to query if the Bitmap has been used in such a way within
de DESTROY subroutine?

Any ideas?

Jouke



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>