Forum > General

SIGSEGV exception for TShape controls

(1/1)

Jonvy:
I get the following SIGSEGV exception for TShape controls,but I don't know the reason and how to solve this problem?Can you help me?

molly:
make sure that you check if the Target is actually containing a valid class value.

If Assigned(Target) then if (Target as TShape).name = 'xxxx' then
begin
end;

or better yet:
If target is TShape then if TShape(Target).name = '' then
begin
end;

or the easy way out (as first statement in your function):
if not assigned(Target) then exit

jamie:
I can't be exactly sure but memory seems to tell me if you create TShape for example at runtime
the NAME is not filled out.. Of course I could be wrong in that assumption but it seems it would make
sense in part as how the OI does it for auto loads.

Jonvy:
Thanks Molly,the problem sovled! :D

--- Quote from: molly on February 24, 2018, 07:14:51 am ---make sure that you check if the Target is actually containing a valid class value.

If Assigned(Target) then if (Target as TShape).name = 'xxxx' then
begin
end;

or better yet:
If target is TShape then if TShape(Target).name = '' then
begin
end;

or the easy way out (as first statement in your function):
if not assigned(Target) then exit

--- End quote ---

Navigation

[0] Message Index

Go to full version