diff --git a/lib/event-libs/glib/glib.c b/lib/event-libs/glib/glib.c index b83134b98..cd2984ece 100644 --- a/lib/event-libs/glib/glib.c +++ b/lib/event-libs/glib/glib.c @@ -37,7 +37,7 @@ #define lws_gs_valid(t) (t.gs) #define lws_gs_destroy(t) if (lws_gs_valid(t)) { \ - g_source_remove(t.tag); \ + g_source_destroy(t.gs); \ g_source_unref(t.gs); \ t.gs = NULL; t.tag = 0; } diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt index ddeb8c480..20abc1920 100644 --- a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt +++ b/minimal-examples/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt @@ -2,6 +2,7 @@ project(lws-minimal-http-server-eventlib-foreign C) cmake_minimum_required(VERSION 2.8) find_package(libwebsockets CONFIG REQUIRED) list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) +include(CheckIncludeFile) include(CheckCSourceCompiles) include(LwsCheckRequirements) @@ -9,6 +10,7 @@ set(SAMP lws-minimal-http-server-eventlib-foreign) set(SRCS minimal-http-server-eventlib-foreign.c) set(requirements 1) +require_pthreads(requirements) require_lws_config(LWS_ROLE_H1 1 requirements) require_lws_config(LWS_WITH_SERVER 1 requirements) @@ -76,9 +78,9 @@ if (requirements) add_executable(${SAMP} ${SRCS}) if (websockets_shared) - target_link_libraries(${SAMP} websockets_shared ${extralibs} ${LIBWEBSOCKETS_DEP_LIBS}) + target_link_libraries(${SAMP} websockets_shared ${extralibs} ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS}) add_dependencies(${SAMP} websockets_shared) else() - target_link_libraries(${SAMP} websockets ${extralibs} ${LIBWEBSOCKETS_DEP_LIBS}) + target_link_libraries(${SAMP} websockets ${extralibs} ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS}) endif() endif()