kooloveme / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 0 forks source link

GDIPlusActive = false when HasGDIPlus = true #301

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?

Multiple THtmlViewer components in the same project, one on a long-lived form, 
the other on a form that is dynamically created and destroyed.

The long-lived THtmlViewer has an OnImageRequest handler to load images from a 
database.

Destroying the dynamically created form causes THtmlViewer to call 
CheckExitGDIPlus (via TStringBitmapList.Destroy) which sets GDIPlusActive to 
false.

Subsequent requests for non-cached images from the long-lived THtmlViewer now 
fail because LoadPngFromStream (in LoadImageFromStream) checks GDIPlusActive

Both THtmlViewer components need to have had content loaded to trigger the call 
to TStringBitmapList.Create

What is the expected output? What do you see instead?

Missing image icon is displayed instead of the image supplied by the 
OnImageRequest handler.

Which version of the product are you using? Which compiler version are you
using? On which operating system?

r436, Delphi XE2, Windows 7 64bit.

Please attach test html files and screenshots, if appropriate.
Please provide any additional information:

Sample project attached.

Click Button1 (long-lived THtmlViewer is loaded, image is displayed, 
GDIPlusActive = true)

Click Button2 (Dynamic form is created, second THtmlViewer is loaded)

Close Form2 (GDIPlusActive = false)

Click Button3 (long-lived THtmlViewer is loaded, image is missing)

Suggest removing last "GDIPlusActive := False" from CheckExitGDIPlus...

Original issue reported on code.google.com by wildcrof...@gmail.com on 10 Sep 2013 at 12:58

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for spotting this issue.

Original comment by OrphanCat on 4 Oct 2013 at 10:19

GoogleCodeExporter commented 9 years ago
r441 fixes this issue.

Original comment by OrphanCat on 4 Oct 2013 at 2:42