function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GunnarGunnar 

No Destructor?

I can't find any docs on the apex destructor. It has one, right? Even VB6 and VBA have destructors.

sfdcfoxsfdcfox
There are no destructors in Apex Code. When an object goes out of scope, it is automatically garbage collected and its resources are reclaimed.

You can vote for this feature here: https://success.salesforce.com/ideaView?id=08730000000Bqcw
GunnarGunnar

I was afraid of that. Bummer.

It's nice to run some code before the instance goes away.

So instead, I'll just write to the database and burn up DML's on every touch.

 

sfdcfoxsfdcfox
Sorry. Wish we did have it. I'd be using those, too.