Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/virtual_dtor.hfa

    r8512a2f r1e940de0  
    2525    __virtual_obj_start = &this;
    2626}
    27 static inline void __CFA_dtor_shutdown( virtual_dtor & this ) with(this) {
     27static inline bool __CFA_dtor_shutdown( virtual_dtor & this ) with(this) {
     28    if ( __virtual_dtor_ptr == 1p ) return true; // stop base dtors from being called twice
    2829    if ( __virtual_dtor_ptr ) {
    2930        void (*dtor_ptr)(virtual_dtor &) = __virtual_dtor_ptr;
    3031        __virtual_dtor_ptr = 0p;
    31         dtor_ptr(*((virtual_dtor *)__virtual_obj_start)); // replace actor with base type
    32         return;
     32        dtor_ptr(*((virtual_dtor *)__virtual_obj_start)); // call most derived dtor
     33        __virtual_dtor_ptr = 1p; // stop base dtors from being called twice
     34        return true;
    3335    }
     36    return false;
    3437}
    3538static inline void __CFA_virt_free( virtual_dtor & this ) { free( this.__virtual_obj_start ); }
Note: See TracChangeset for help on using the changeset viewer.