1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

glibc: fixed GSources destroy with non-default main context

This commit is contained in:
Sergey Radionov 2020-07-19 11:16:02 +01:00 committed by Andy Green
parent 355be53fa6
commit fbadad7f52
2 changed files with 5 additions and 3 deletions

View file

@ -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; }

View file

@ -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()