From e5d3fff54d97b2fddc7f72188379bba301b5648e Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 23 Aug 2023 17:31:25 +0200 Subject: [PATCH] Adapt to new api introduced in kiwix/libkiwix#991 --- lib/src/main/cpp/libkiwix/kiwixserver.cpp | 2 +- lib/src/main/cpp/libkiwix/library.cpp | 2 +- lib/src/main/cpp/libkiwix/manager.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/main/cpp/libkiwix/kiwixserver.cpp b/lib/src/main/cpp/libkiwix/kiwixserver.cpp index ae46afa..42bab5d 100644 --- a/lib/src/main/cpp/libkiwix/kiwixserver.cpp +++ b/lib/src/main/cpp/libkiwix/kiwixserver.cpp @@ -35,7 +35,7 @@ METHOD(void, setNativeServer, jobject jLibrary) { auto library = getPtr(env, jLibrary); - SET_PTR(std::make_shared(library.get())); + SET_PTR(std::make_shared(library)); } catch (std::exception& e) { throwException(env, "java/lang/Exception", "Error creating the server"); } CATCH_EXCEPTION() diff --git a/lib/src/main/cpp/libkiwix/library.cpp b/lib/src/main/cpp/libkiwix/library.cpp index 1ce3ccd..f65828b 100644 --- a/lib/src/main/cpp/libkiwix/library.cpp +++ b/lib/src/main/cpp/libkiwix/library.cpp @@ -31,7 +31,7 @@ /* Kiwix Reader JNI functions */ METHOD0(void, setNativeHandler) { - SET_PTR(std::make_shared()); + SET_PTR(NATIVE_TYPE::create()); } CATCH_EXCEPTION() DISPOSE diff --git a/lib/src/main/cpp/libkiwix/manager.cpp b/lib/src/main/cpp/libkiwix/manager.cpp index 01da4da..0bc7a0d 100644 --- a/lib/src/main/cpp/libkiwix/manager.cpp +++ b/lib/src/main/cpp/libkiwix/manager.cpp @@ -31,7 +31,7 @@ METHOD(void, allocate, jobject libraryObj) { auto lib = getPtr(env, libraryObj); - SET_PTR(std::make_shared(lib.get())); + SET_PTR(std::make_shared(lib)); } CATCH_EXCEPTION() DISPOSE