From 79c2018a6767d4685e2bb88b7ad8f1d0a2a3fcfe Mon Sep 17 00:00:00 2001 From: "Tim.Ebbeke" Date: Mon, 28 Aug 2023 11:38:45 +0200 Subject: [PATCH 1/2] Fixed binaryen pull on Ubuntu. --- cmake/dependencies/binaryen.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmake/dependencies/binaryen.cmake b/cmake/dependencies/binaryen.cmake index 91c9de9..d8cb21b 100644 --- a/cmake/dependencies/binaryen.cmake +++ b/cmake/dependencies/binaryen.cmake @@ -1,12 +1,17 @@ option(NUI_FETCH_BINARYEN "Fetch binaryen" ON) -set(NUI_BINARYEN_URL "https://github.com/WebAssembly/binaryen/releases/download/version_112/binaryen-version_112-x86_64-windows.tar.gz" CACHE STRING "Binaryen url") + +if (WIN32) + set(NUI_BINARYEN_URL "https://github.com/WebAssembly/binaryen/releases/download/version_114/binaryen-version_114-x86_64-windows.tar.gz" CACHE STRING "Binaryen url") +elseif(UNIX) + set(NUI_BINARYEN_URL "https://github.com/WebAssembly/binaryen/releases/download/version_114/binaryen-version_114-x86_64-linux.tar.gz" CACHE STRING "Binaryen url") +endif() if (NUI_FETCH_BINARYEN) include(FetchContent) FetchContent_Declare( binaryen_release - URL ${NUI_BINARYEN_URL} - DOWNLOAD_EXTRACT_TIMESTAMP true + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + URL "${NUI_BINARYEN_URL}" ) FetchContent_GetProperties(binaryen_release) if (binaryen_release_POPULATED) From a47180a09619759fdf84be9e7602727ef3d613a7 Mon Sep 17 00:00:00 2001 From: "Tim.Ebbeke" Date: Mon, 28 Aug 2023 11:47:04 +0200 Subject: [PATCH 2/2] Fixed scheme handler cleanup. --- nui/src/nui/backend/window.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nui/src/nui/backend/window.cpp b/nui/src/nui/backend/window.cpp index 4b37261..14c097e 100644 --- a/nui/src/nui/backend/window.cpp +++ b/nui/src/nui/backend/window.cpp @@ -74,12 +74,6 @@ namespace Nui GInputStream* stream; SoupMessageHeaders* headers; WebKitURISchemeResponse* response; - - ~SchemeContext() - { - g_object_unref(stream); - soup_message_headers_free(headers); - } #endif }; // ##################################################################################################################### @@ -187,8 +181,13 @@ extern "C" { } exitError.disarm(); + schemeContext->stream = g_memory_input_stream_new_from_data(fileContent.c_str(), static_cast(fileContent.size()), nullptr); + auto deleteStream = Roar::ScopeExit{[schemeContext] { + g_object_unref(schemeContext->stream); + }}; + const auto maybeMime = Roar::extensionToMime(filePath.extension().string()); schemeContext->mime = maybeMime ? *maybeMime : "application/octet-stream";