From d2d04f764d09389b66786c7fbb19ffc13f2bec4a Mon Sep 17 00:00:00 2001 From: bjcollins Date: Fri, 27 Jun 2014 14:46:27 -0500 Subject: [PATCH] Find glibconfig.h cmake should use pkgconfig information instead of a hard coded path to /usr/lib. the OnOpen callback should be called when set to avoid a segfault. --- channels/drdynvc/client/dvcman.c | 3 ++- channels/tsmf/client/tsmf_main.c | 1 + cmake/FindGlib.cmake | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/channels/drdynvc/client/dvcman.c b/channels/drdynvc/client/dvcman.c index bd3718a60..a29e5509e 100644 --- a/channels/drdynvc/client/dvcman.c +++ b/channels/drdynvc/client/dvcman.c @@ -409,7 +409,8 @@ int dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId if (channel->status == 0) { pCallback = channel->channel_callback; - pCallback->OnOpen(pCallback); + if (pCallback->OnOpen) + pCallback->OnOpen(pCallback); } return 0; diff --git a/channels/tsmf/client/tsmf_main.c b/channels/tsmf/client/tsmf_main.c index ec0426fba..e6fd20530 100644 --- a/channels/tsmf/client/tsmf_main.c +++ b/channels/tsmf/client/tsmf_main.c @@ -329,6 +329,7 @@ static int tsmf_on_new_channel_connection(IWTSListenerCallback *pListenerCallbac ZeroMemory(callback, sizeof(TSMF_CHANNEL_CALLBACK)); callback->iface.OnDataReceived = tsmf_on_data_received; callback->iface.OnClose = tsmf_on_close; + callback->iface.OnOpen = NULL; callback->plugin = listener_callback->plugin; callback->channel_mgr = listener_callback->channel_mgr; callback->channel = pChannel; diff --git a/cmake/FindGlib.cmake b/cmake/FindGlib.cmake index 3e22eb075..8005ce12b 100644 --- a/cmake/FindGlib.cmake +++ b/cmake/FindGlib.cmake @@ -28,11 +28,10 @@ find_library(Gobject_LIBRARY PATHS ${Glib_PKGCONF_LIBRARY_DIRS} ${GLIB_ROOT_DIR} ) -# Glib-related libraries also use a separate config header, which is in lib dir +# Glib-related libraries also use a separate config header, which is relative to lib dir find_path(GlibConfig_INCLUDE_DIR NAMES glibconfig.h - PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr ${GLIB_ROOT_DIR} - PATH_SUFFIXES lib/glib-2.0/include glib-2.0/include + PATHS ${Glib_PKGCONF_INCLUDE_DIRS} ${GLIB_ROOT_DIR} ) # Set the include dir variables and the libraries and let libfind_process do the rest.