vintagedave / firemonkey-container

Automatically exported from code.google.com/p/firemonkey-container
92 stars 34 forks source link

Assert in UnSubClassVCLForm when adding new hosted FMX form after closing a previous one #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported by Fiachra Bonner

Setup: one VCL form; dynamically add tabs with FMX forms embedded on each tab.  
After closing a tab and freeing the FMX form (fcaFree), adding a new FMX form 
will cause an assert.

--

Appears to be caused by the VCL form WindowProc never being unset.  Unsetting 
happens too late in the destruction process when the component is freed (when a 
tab is closed) and so GetParentForm() returns nil.  Resolved by keeping a 
reference to the form that had WindowProc changed.

BUT: When multiple TFireMonkeyContainer instances on a single VCL form, the 
WindowProc gets set/unset multiple times - can get out of sync.  Need to set 
once per VCL form.  In progress...

Original issue reported on code.google.com by vintaged...@gmail.com on 8 May 2014 at 1:47

GoogleCodeExporter commented 9 years ago
Also fixed: multiple window proc hooking.  A form's window procedure is now 
hooked/unhooked once only, no matter how many FMX containers are on it.  
Implementation uses a helper class to both install the hooks and implement the 
new window proc.

Original comment by vintaged...@gmail.com on 9 May 2014 at 3:36

GoogleCodeExporter commented 9 years ago

Original comment by vintaged...@gmail.com on 9 May 2014 at 3:36