[fpc-pascal] "is" for interfaces patch

ml ml at brainwashers.org
Thu Mar 31 01:01:21 CEST 2005

operator "is" is finished, but before I send patch I would like to
correct one other problem with "as" (my previous patch was not enough to
fix all problems with refcount, it was enough to correct all others

refcount now works correctly with :=, GetInterface, QueryInterface and

a := (obj as IA); // works
b := (obj as IA); // works

but as soon as you invoke again
a := (obj as IA);
b := (obj as IA);

it decrements one. Funny thing is that this doesn't happen the first
time, but any later try to set the same variable decrements one and
doesn't stay the same as it should. (and that only happens with "as")

This wouldn't be a problem if that wouldn't exclude using it like
(c as IA).A;
(c as IA).B;

Has anyone idea why this would happen'??? I will probably find it if I
dissect sources, but it would be nice if someone would have idea where
the problem lies. (at least some draft pointer where should I look)


More information about the fpc-pascal mailing list