Re: [AD] Problem with remove_mouse() and video bitmaps. |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> > If the destroy_bitmap() function automatically nulled out the bitmap
> > pointer, it would be trivial to add a check to avoid drawing onto an
> > invalid bitmap. While this wouldn't be the end of this kind of
> > problems, it would help allegro become more robust. It wouldn't break
> > compatibility either (though programs using an old dll would be more
> > crash prone).
> >
> > Is there an obvious reason against this that I missed? (very
> > probable). Otherwise, I think I could submit a patch for this one if
> > the following days.
>
>
> explain how that would work ?
As far as I can tell, I think he means something like
void destroy_bitmap(BITMAP *bmp)
{
/* do stuff */
...
bmp = NULL;
}
which obviously wouldn't do anything. Unless we're going to do specific
checks from within destroy_bitmap() to see wether or not the mouse is
displayed on that bitmap (ugh), the only thing we can do is to tell people
that the mouse muct be removed from the bitmap before it is destroyed.
Which does make some sense, let's be honest.
Evert