Browse Source

* pas2jni: Fixed double memory freeing when using method pointers in some rare cases.

git-svn-id: trunk@34843 -
yury 8 years ago
parent
commit
3fd3ff9527
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/pas2jni/writer.pas

+ 1 - 1
utils/pas2jni/writer.pas

@@ -1775,8 +1775,8 @@ begin
       Fps.WriteLn('else begin');
       Fps.WriteLn('mpi:=_TMethodPtrInfo.Create(env, nil, '''', '''');', 1);
       Fps.WriteLn('mpi.RealMethod:=m;', 1);
-      Fps.WriteLn('InterlockedIncrement(mpi.RefCnt);', 1);
       Fps.WriteLn('end;');
+      Fps.WriteLn('InterlockedIncrement(mpi.RefCnt);');
       Fps.WriteLn('finally', -1);
       Fps.WriteLn('_MethodPointersCS.Leave;');
       Fps.DecI;