I created a component decending from TComboBox that manipulates the items.objects property within itself.
When I try to free the objects, which I added with AddObject, in MyComboBox.Destroy I get the following error:
Project myproject.exe raised exception class EInvalidOperation with message 'Control '' has no parent window'. Process stopped ...
This is my destructor for the Combo decendant:
var i: integer;
for i := 0 to (Items.Count - 1) do
if Assigned(items.Objects[i]) then
items.Objects[i] := nil;
How can I avoid the exception from occuring and still free the objects attached to the combo's items?