@@ -559,7 +559,8 @@ sub symbUdtDeclareDefaultMembers _
559559 default .copyctor = NULL
560560 default .copyctorconst = NULL
561561 default .copyletopconst = NULL
562- default .dtor = NULL
562+ default .dtor1 = NULL
563+ default .dtor0 = NULL
563564
564565 '' Ctor/inited fields and no ctor yet?
565566 if ( (symbGetUDTHasCtorField( udt ) or symbGetUDTHasInitedField( udt )) and _
@@ -618,12 +619,18 @@ sub symbUdtDeclareDefaultMembers _
618619 symbUdtAllocExt( udt )
619620
620621 '' no default dtor explicitly defined?
621- if ( udt->udt.ext->dtor = NULL ) then
622- '' Complete Dtor
623- default .dtor = hDeclareProc( udt, INVALID, FB_DATATYPE_INVALID, FB_SYMBATTRIB_NONE, FB_PROCATTRIB_DESTRUCTOR1 )
622+ if ( udt->udt.ext->dtor1 = NULL ) then
623+
624+ assert( udt->udt.ext->dtor0 = NULL )
625+
626+ '' Complete dtor
627+ default .dtor1 = hDeclareProc( udt, INVALID, FB_DATATYPE_INVALID, FB_SYMBATTRIB_NONE, FB_PROCATTRIB_DESTRUCTOR1 )
628+
629+ '' Deleting dtor
630+ default .dtor0 = hDeclareProc( udt, INVALID, FB_DATATYPE_INVALID, FB_SYMBATTRIB_NONE, FB_PROCATTRIB_DESTRUCTOR0 )
624631
625632 '' Don't allow the implicit dtor to override a FINAL dtor from the base
626- symbProcCheckOverridden( default .dtor , TRUE )
633+ symbProcCheckOverridden( default .dtor1 , TRUE )
627634 end if
628635 end if
629636
@@ -685,8 +692,12 @@ sub symbUdtImplementDefaultMembers _
685692 hAddCtorBody( udt, default .copyctor, TRUE )
686693 end if
687694
688- if ( default .dtor ) then
689- hAddCtorBody( udt, default .dtor, FALSE )
695+ if ( default .dtor1 ) then
696+ hAddCtorBody( udt, default .dtor1, FALSE )
697+ end if
698+
699+ if ( default .dtor0 ) then
700+ hAddCtorBody( udt, default .dtor0, FALSE )
690701 end if
691702
692703end sub
@@ -733,7 +744,7 @@ end function
733744function symbCompIsTrivial( byval sym as FBSYMBOL ptr ) as integer
734745 assert( symbIsStruct( sym ) )
735746 function = ((symbGetCompCopyCtor( sym ) = NULL) and _
736- (symbGetCompDtor ( sym ) = NULL) and _
747+ (symbGetCompDtor1 ( sym ) = NULL) and _
737748 ( not symbGetHasRTTI( sym )))
738749end function
739750
@@ -783,13 +794,24 @@ sub symbCheckCompCtor( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
783794 end if
784795end sub
785796
786- sub symbSetCompDtor ( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
797+ sub symbSetCompDtor1 ( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
787798 if ( symbIsStruct( sym ) ) then
788799 assert( symbIsDestructor1( proc ) )
789800 symbUdtAllocExt( sym )
790- if ( sym->udt.ext->dtor = NULL ) then
801+ if ( sym->udt.ext->dtor1 = NULL ) then
802+ '' Add dtor
803+ sym->udt.ext->dtor1 = proc
804+ end if
805+ end if
806+ end sub
807+
808+ sub symbSetCompDtor0( byval sym as FBSYMBOL ptr, byval proc as FBSYMBOL ptr )
809+ if ( symbIsStruct( sym ) ) then
810+ assert( symbIsDestructor0( proc ) )
811+ symbUdtAllocExt( sym )
812+ if ( sym->udt.ext->dtor0 = NULL ) then
791813 '' Add dtor
792- sym->udt.ext->dtor = proc
814+ sym->udt.ext->dtor0 = proc
793815 end if
794816 end if
795817end sub
@@ -821,11 +843,21 @@ private function symbGetCompCopyCtor( byval sym as FBSYMBOL ptr ) as FBSYMBOL pt
821843 end if
822844end function
823845
824- function symbGetCompDtor( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
846+ function symbGetCompDtor1( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
847+ if ( sym ) then
848+ if ( symbIsStruct( sym ) ) then
849+ if ( sym->udt.ext ) then
850+ function = sym->udt.ext->dtor1
851+ end if
852+ end if
853+ end if
854+ end function
855+
856+ function symbGetCompDtor0( byval sym as FBSYMBOL ptr ) as FBSYMBOL ptr
825857 if ( sym ) then
826858 if ( symbIsStruct( sym ) ) then
827859 if ( sym->udt.ext ) then
828- function = sym->udt.ext->dtor
860+ function = sym->udt.ext->dtor0
829861 end if
830862 end if
831863 end if
0 commit comments