Explorar el Código

pastojs: fixed calling destructor after exception in constructor

git-svn-id: trunk@40116 -
Mattias Gaertner hace 6 años
padre
commit
ff431f0106
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      utils/pas2js/dist/rtl.js

+ 4 - 4
utils/pas2js/dist/rtl.js

@@ -279,8 +279,8 @@ var rtl = {
           o.AfterConstruction();
         } catch($e){
           // do not call BeforeDestruction
-          if (this.Destroy) this.Destroy();
-          this.$final();
+          if (o.Destroy) o.Destroy();
+          o.$final();
           throw $e;
         }
         return o;
@@ -314,8 +314,8 @@ var rtl = {
         if (o.AfterConstruction) o.AfterConstruction();
       } catch($e){
         // do not call BeforeDestruction
-        if (this.Destroy) this.Destroy();
-        if (this.$final) this.$final();
+        if (o.Destroy) o.Destroy();
+        if (o.$final) this.$final();
         throw $e;
       }
       return o;