Răsfoiți Sursa

pastojs: fixed calling destructor after exception in constructor

git-svn-id: trunk@40116 -
Mattias Gaertner 6 ani în urmă
părinte
comite
ff431f0106
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 4 4
      utils/pas2js/dist/rtl.js

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

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