[haiku-bugs] Re: [Haiku] #7736: Browsing back to a rotated image crashes ShowImage

  • From: "Janus" <trac@xxxxxxxxxxxx>
  • Date: Mon, 17 Dec 2012 06:40:23 -0000

#7736: Browsing back to a rotated image crashes ShowImage
--------------------------------------+----------------------------
   Reporter:  humdinger               |      Owner:  leavengood
       Type:  bug                     |     Status:  new
   Priority:  normal                  |  Milestone:  R1
  Component:  Applications/ShowImage  |    Version:  R1/Development
 Resolution:                          |   Keywords:  GCI2011
 Blocked By:                          |   Blocking:
Has a Patch:  1                       |   Platform:  All
--------------------------------------+----------------------------

Comment (by Janus):

 A simple explanation...

 If fBitmapOwner isn't set, the invocation of _DeleteBitmap deletes fBitmap
 instead of releasing the reference (fBitmapOwner).


 {{{
 void
 ShowImageView::_DeleteBitmap()
 {
         _DeleteSelectionBitmap();

         if (fDisplayBitmap != fBitmap)
                 delete fDisplayBitmap;
         fDisplayBitmap = NULL;

         if (fBitmapOwner != NULL)
                 fBitmapOwner->ReleaseReference();
         else{
                 delete fBitmap;
         }
         fBitmapOwner = NULL;
         fBitmap = NULL;
 }

 }}}




 After that you have an invalid pointer stored in ImageCache.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7736#comment:9>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: