Skip to content

Commit

Permalink
Attempt to close file
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Dec 21, 2024
1 parent f1a7117 commit e80100b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions native/common/jp_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ std::string getShared()
{
// This is needed when there is no-ascii characters in path
char shortPathBuffer[MAX_PATH];
GetShortPathName(path, shortPathBuffer, MAX_PATH);
return shortPathBuffer;
long len = GetShortPathName(path, shortPathBuffer, MAX_PATH);
if (len != 0)
return std::string(shortPathBuffer);
}
#else
// Linux specific
Expand Down
9 changes: 9 additions & 0 deletions native/java/org/jpype/JPypeContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.jpype;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -282,6 +283,14 @@ private void shutdown()
{
run.run();
}
try
{
classLoader.close();
} catch (IOException ex)
{
// ignored
}


}

Expand Down

0 comments on commit e80100b

Please sign in to comment.