Boian Mitov schrieb:
That is easy. it gets incremented when it gets assigned. The running threads have no way of accessing it if there is no reference (assignment) already in place.

The problem arises when an object is destroyed, or even elected for destruction in _Release, while another thread starts using the same instance.

Indeed that is how it works in Delphi, and BTW: that is how Strings work in Delphi and FPC the last time I checked ;-) .

With strings it's possible to create another (unique) copy, when a string is modified, and it does no harm when that copy is destroyed later - every user will find an valid (empty) string. Not so with objects, which cannot be copied nor reused after destruction.

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to