Solving heap corruption/ undefined behaviors is really frustrating.
And Bitmap </> is one of such culprit, there are two major issues with
Bitmap.
1) App developer doesn't have a clue that Bitmap is wrapped over Skia, and
Skia is *thread-UNSAFE.*
So, all those using Bitmap in non-UI threads (AsyncTask,..etc) are on
dangerous edge of Undefined/heap-corruption ..and many more...endless
issues.
2) *API documentation is not well described, *say for example:
* Bitmap.createScaledBitmap() *, doesn't say anywhere that it may
return *same source bitmap *based on input parameters passed, more on this
link<http://stackoverflow.com/questions/6278992/does-bitmap-createscaledbitmap-convert-an-32-bit-image-into-24-bit>
.
So, those believing that it always returns a new scaled bitmap, would
end in* race condition* when passed to a non-UI thread,so** a recipe for
all Undefined behaviors, more over if one of thread does *Bitmap.Recycle()*,
then no one is there to save you.
-Mark
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en