From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3606a072272ee7d2,start X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: differentiating finalization causes Date: 1997/10/29 Message-ID: <01bce4a2$b0ad17e0$020c6dce@my-pc.neosoft.com>#1/1 X-Deja-AN: 285823999 Organization: Software Arts and Sciences Newsgroups: comp.lang.ada Date: 1997-10-29T00:00:00+00:00 List-Id: For a type descended from Controlled, I need to be able to differentiate finalization due to object destruction from finalization due to assignment ("value destruction", if you will). At present I use the subsequent call to Adjust to set a flag, with other routines checking the flag to see if the effect of Finalize was really due to assignment. However, Finalize is responsible for placing an item in a list, and Adjust must search the list, looking for the corresponding node (in which to set the flag). I don't want to search this list each time Adjust is called, but of course I cannot keep a pointer to the node in the controlled object itself, since assignment will overwrite it with the value on the right-hand side. Are there any "tricks" or techniques for differentiating between the two causes of finalization?