System.NullReferenceException in CreateOrUpdateBitmap of WritableBitmapRenderHandler #4612
-
I am starting this as a discussion as I am new here and not sure how to best get it in as a bug report. In summary, we have a large C++/C++CLI/C# application that embeds CEFSharp in some of our views. In addition, we have a rather robust "journaling" system that allows us to playback interactions with the UI and other things on our application.. Recently, we noticed that we are experiencing sporadic NullReferenceExceptions when playing back some of our journals for testing.. I have traced down the issue to the way threading and related optimizations work with WritableBitmapRenderHandler and specifically the CreateOrUpdateBitmap handler. The issue is that the it appears when timing is just right on our playbacks, the following code triggers, with no bitmap having been constructed (I.e. image.Source is null) I hand traced the threading and it seems that what is going is that background things are happening quickly enough such that one of the following "short circuits" break out of the first time delegate is run, leaving no bitmap ever created: We locally have a fix for this and it simply is updating the following line: to read as follows to make sure image.Source is always valid...
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Pull requests are welcome, please create a PR with your proposed changes 👍 |
Beta Was this translation helpful? Give feedback.
Pull requests are welcome, please create a PR with your proposed changes 👍