Scalerichview and action load with other form

General TRichView support forum. Please post your questions here
Post Reply
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Scalerichview and action load with other form

Post by RobertoVG »

Two strange situations involving release memory resources with ScaleRichview and Action

place the form in the example ... ScaleRichView \ Demos \ ActionTest ( form3 ) loaded as fsNormal through another form1 ( for example) .

In onClose method to terminate the form3 and release it from memory , put
action : = caFree .

when the form3 is closed , it generates an exception .
If the action statement : = caFree is removed , there is no exception.

If this example were any other simple form without using ScaleRichView and action ( eg form 4 ) , to shut it down with the action statement : = caFree not occur excption and form 4 is effectively removed from memory.

This indicates that the form3 ( ScaleRichView and actions ) contains instructions as to close the form would be released from memory . But this does not happen ! After closing the form3 if you instruct to form3.visible : = true , and form3.show the form3 is being shown .

So the question is how to effectively remove the form3 memory when loaded into another form ?

Why is not free from memory ?

When you created this example using actions (srvActionsResource in the form3), and to end the close form is not necessary to release it from memory? Why?

The most curious is that the memcheck (*see instruction below*) report memory leak from srvActionsResource. You know the reason?

(*
program ActionTest;
uses
MemCheck,
Forms,
dmActionsSRV in 'dmActionsSRV.pas' {srvActionsResource: TDataModule},
Unit3 in 'Unit3.pas' {Form3};
{$R *.res}
begin
MemChk; *)
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG »

correction of the previous message:

The most curious is that the memcheck (*see instruction below*) DO NOT report memory leak from srvActionsResource. You know the reason?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

My guess: if you used ActionTest form with ScaleRichView, it assigns Application.OnHint. The procedure assigned to Application.OnHint refers to the status bar control on this form.
If the form is destroyed, any attempt to display hint will lead to exception.

Solution - assign Application.OnHint := nil when closing the form.
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

exception - Applications Hint after close Form with caFree

Post by RobertoVG »

I confirm that you resolved the issue.

Thanks!
Post Reply