Skip to content

Commit

Permalink
Create temp directory for java android
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlizarraga committed Dec 19, 2024
1 parent 4172575 commit 3e39b88
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions java/src/main/java/ai/onnxruntime/OnnxRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static synchronized void init() throws IOException {
if (loaded) {
return;
}
tempDirectory = isAndroid() ? null : Files.createTempDirectory("onnxruntime-java");
tempDirectory = Files.createTempDirectory("onnxruntime-java");
try {
libraryDirPathProperty = System.getProperty(ONNXRUNTIME_NATIVE_PATH);
// Extract and prepare the shared provider library but don't try to load it,
Expand All @@ -181,9 +181,7 @@ static synchronized void init() throws IOException {
version = initialiseVersion();
loaded = true;
} finally {
if (tempDirectory != null) {
cleanUp(tempDirectory.toFile());
}
cleanUp(tempDirectory.toFile());
}
}

Expand Down

0 comments on commit 3e39b88

Please sign in to comment.