On Friday 2014-08-08 11:25 -0400, Ehsan Akhgari wrote:
> The problem I was mentioning is not related to the leak at all.
> What if one of these destructors runs code that writes something to
> the disk for example, which we expect to go to the disk before we
> shut down?

User-visible actions should never be in destructors, except for RAII
classes, because having a complex system with garbage collection and
potentially with leaks means that we can't guarantee when
destructors will run.  Destructors should (transitively) contain
only things that wouldn't be there if we were writing in a higher
level language that did memory management for us.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to