- This topic has 10 replies, 2 voices, and was last updated 4 years, 9 months ago by Support.
-
AuthorPosts
-
October 13, 2019 at 1:49 pm #62379HeDiBoParticipant
Sometimes a ShowPopupForm will give an exception:
This is the trace leading to the exception:
My procedure: procedure TfrCompetition.btnAddPoolClick(Sender: TObject); var p: TPoint; begin btnAddPool.Enabled := False; if not Assigned(frmAddPool2Comp) then frmAddPool2Comp := TfrmAddPool2Comp.Create(Self); p := btnAddPool.ClientToScreen(Point(0, btnAddPool.Height)); ShowPopupForm(frmAddPool2Comp, p); // Will throw exception end; acPopupController: lines 130-134 procedure ShowPopupForm(AForm: TForm; ALeftTop: TPoint; Animated: boolean = True); begin GetIntController.KillAllForms(AForm); // <<< Throws exception acIntController.ShowFormPos(AForm, ALeftTop, Animated); end; acPopupController: lines 137-146: procedure TsPopupController.KillAllForms(ExceptChild: TForm); var i: integer; ParentForm: TForm; ClosedAll: boolean; begin if ExceptChild <> nil then ParentForm := TForm(GetOwnerForm(ExceptChild.Owner)) // <<< Throws exception else ParentForm := nil; sVclUtils: lines 3146-3175: function GetOwnerForm(const Component: TComponent): TCustomForm; var c: TComponent; begin Result := nil; c := Component; // <<< Component is an invalid address ($80808080) while Assigned(c) and not (c is TCustomForm) do c := c.Owner; if c is TCustomForm then Result := TCustomForm(c); end;
Apparently the ExceptChild.Owner may be freed without being nil.
October 14, 2019 at 9:35 pm #62440SupportKeymasterApparently the ExceptChild.Owner may be freed without being nil.
Yes, looks like that. But I can’t imagine when owner may be destroyed here.
Is it possible to make a test-app with such problem?October 15, 2019 at 12:14 am #62442HeDiBoParticipantYes, looks like that. But I can’t imagine when owner may be destroyed here.
Is it possible to make a test-app with such problem?I’ll have another look at it tomorrow.
October 15, 2019 at 3:53 pm #62480HeDiBoParticipantFound the bug.
My project consists of a large number of TFrames, placed on pages of a giant TsPageControl. Some of these frames may show pupup windows. If these windows close, they set the Action to caFree and set there form variable to nil.
One of the popup windows did not set the form variable to nil. Causing the problem.
I still think it’s a bug in AC. Setting Action to caFree should be enough.October 17, 2019 at 6:26 pm #62766SupportKeymasterHello!
The package doesn’t use these variables, they are not accessible in units of the package.
If I understand you correctly.
Can you help me to repeat the error, please? Is it possible in a separate demo-app?October 19, 2019 at 1:00 pm #62961HeDiBoParticipantSorry Serge,
It was my own stupid mistake 😳
December 3, 2019 at 2:10 pm #68198HeDiBoParticipantThis one can be closed.
Previously I could close topics myself. Is there some way now to do that? That is, can I add the tag [Resolved] myself?December 9, 2019 at 12:09 am #68217SupportKeymasterTopic may be closed by author or by admin in the his first message.
Attachments:
You must be logged in to view attached files.December 9, 2019 at 7:38 pm #68224HeDiBoParticipantJanuary 25, 2020 at 2:55 pm #68276HeDiBoParticipantAny progress on letting authors close their own topics?
January 26, 2020 at 8:41 am #68286SupportKeymasterNo, sorry. Can’t find how to make it in the WP still.
-
AuthorPosts
- You must be logged in to reply to this topic.