[fpc-pascal] SIGSEGV in SYSTEM_TOBJECT_$__CLEANUPINSTANCE when calling from C app

Matthias Klumpp matthias at nlinux.org
Mon Dec 13 17:50:46 CET 2010


Hi!
I created a C application which calls methods from a library developed in
Pascal.
I can create objects by using
void *test;
test = br_object_new ();
and access the object too, but when I try to free an object after it has
been used, I get a segfault in SYSTEM_TOBJECT_$__CLEANUPINSTANCE.
The code to free an object looks like to following:
procedure br_object_free(obj: PObject);cdecl;
begin
 if obj^ = nil then exit;
 FreeAndNil(obj^);
end;
I can access all properties of obj^, as well as calling methods. I only
cannot free the object.
Does someone have an idea why the application behaves like this? I use FPC
2.4.0.
Kind regards
  Matthias Klumpp





More information about the fpc-pascal mailing list