Browse Source

* Changes to make it more compatible to other connectors

git-svn-id: trunk@23016 -
michael 12 years ago
parent
commit
e8580b5d9c
1 changed files with 20 additions and 8 deletions
  1. 20 8
      packages/ibase/src/ibase60.inc

+ 20 - 8
packages/ibase/src/ibase60.inc

@@ -2463,10 +2463,8 @@ function InitialiseIBase60(Const LibraryName : AnsiString) : integer;
 function InitialiseIBase60 : integer;
 function InitialiseIBase60 : integer;
 procedure ReleaseIBase60;
 procedure ReleaseIBase60;
 
 
-var
-  IBaseLibraryHandle : TLibHandle;
-  IBaseLoadedLibrary : AnsiString;
-
+Function IBaseLibraryHandle : TLibHandle;
+Function IBaseLoadedLibrary : AnsiString;
 {$ENDIF}
 {$ENDIF}
 
 
 implementation
 implementation
@@ -2481,6 +2479,20 @@ ResourceString
   
   
 var 
 var 
   RefCount : integer;
   RefCount : integer;
+  LoadedLibrary : AnsiString;
+  LibHandle : TLibHandle;
+  
+Function IBaseLibraryHandle : TLibHandle;
+
+begin
+  result:=LibHandle;
+end;
+
+Function IBaseLoadedLibrary : AnsiString;
+  
+begin
+  Result:=LoadedLibrary;
+end;  
 
 
 Function TryInitialiseIBase60(Const LibraryName : AnsiString) : integer;
 Function TryInitialiseIBase60(Const LibraryName : AnsiString) : integer;
 
 
@@ -2488,8 +2500,8 @@ begin
   Result := 0;
   Result := 0;
   if (RefCount=0) then
   if (RefCount=0) then
     begin
     begin
-    IBaseLibraryHandle:=LoadLibrary(LibraryName);
-    if (IBaseLibraryHandle=nilhandle) then
+    LibHandle:=LoadLibrary(LibraryName);
+    if (LibHandle=nilhandle) then
       Exit;
       Exit;
     inc(RefCount);
     inc(RefCount);
     IBaseLoadedLibrary:=LibraryName;
     IBaseLoadedLibrary:=LibraryName;
@@ -2710,10 +2722,10 @@ Procedure ReleaseIBase60;
 begin
 begin
   if RefCount>1 then
   if RefCount>1 then
     Dec(RefCount)
     Dec(RefCount)
-  else if UnloadLibrary(IBaseLibraryHandle) then 
+  else if UnloadLibrary(LibHandle) then 
     begin
     begin
     Dec(RefCount);
     Dec(RefCount);
-    IBaseLibraryHandle := NilHandle;
+    LibHandle := NilHandle;
     IBaseLoadedLibrary:='';
     IBaseLoadedLibrary:='';
     end;
     end;
 end;
 end;