I had a look at your fix. I see that you added a call to "release" in the destructor. Just for the record, there's no guarantee that the destructor of a GC allocated object gets run, at all.

Omg, how embarrassing ;) of course I need to put it in dealloc so that it will work with NSMutableArray et al. if I am going Objective-C memory management, then I should do it the intended way indeed!


Or, if this class get instantiated by some Objective-C framework then it will know nothing about the destructor in D. I guess the right solution is to override "dealloc".

So far, I was not even considering a D library that would be used through Objective-C code, but yeah, that's a good point as well.

Hmm, I'm wondering if it's a good idea to lower a destructor to "dealloc", just like a constructor is lowered to "init".

We will have to find out, but dealloc definitely is the destructor in Objc.

  • Re: D/Objective-C 64bit Christian Schneider via Digitalmars-d-announce
    • Re: D/Objective-C 64bi... Jacob Carlborg via Digitalmars-d-announce
      • Re: D/Objective-C ... Christian Schneider via Digitalmars-d-announce
        • Re: D/Objectiv... Jacob Carlborg via Digitalmars-d-announce
          • Re: D/Obje... Christian Schneider via Digitalmars-d-announce
            • Re: D... Jacob Carlborg via Digitalmars-d-announce
              • R... John Colvin via Digitalmars-d-announce
                • ... Jacob Carlborg via Digitalmars-d-announce
              • R... Christian Schneider via Digitalmars-d-announce
                • ... Jacob Carlborg via Digitalmars-d-announce
                • ... Christian Schneider via Digitalmars-d-announce
                • ... Jacob Carlborg via Digitalmars-d-announce
                • ... Christian Schneider via Digitalmars-d-announce
                • ... Christian Schneider via Digitalmars-d-announce
                • ... Michel Fortin via Digitalmars-d-announce
                • ... Christian Schneider via Digitalmars-d-announce
                • ... Jacob Carlborg via Digitalmars-d-announce
                • ... Christian Schneider via Digitalmars-d-announce
                • ... Jacob Carlborg via Digitalmars-d-announce

Reply via email to