Skip to content

Commit

Permalink
should fix UnloadPlugin bug
Browse files Browse the repository at this point in the history
  • Loading branch information
matortheeternal committed Nov 4, 2018
1 parent 412265d commit 349e02a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xeSetup.pas
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ procedure LoadResources;
function IndexOfFile(const _file: IwbFile): Integer;
begin
for Result := Low(xFiles) to High(xFiles) do
if xFiles[Result] = _file then exit;
if xFiles[Result].Equals(_file) then exit;
Result := -1;
end;

Expand Down Expand Up @@ -913,7 +913,7 @@ function UnloadPlugin(_id: Cardinal): WordBool; cdecl;
if not Supports(Resolve(_id), IwbFile, _file)
or not Supports(_file, IwbContainer, container) then
raise Exception.Create('Interface must be a file.');
if not xFiles[High(xFiles)].Equals(_file) then
if IndexOfFile(_file) <> High(xFiles) then
raise Exception.Create('Can only unload last plugin loaded.');
ForceClose(_file);
Result := Release(_id);
Expand Down

0 comments on commit 349e02a

Please sign in to comment.