Find glibconfig.h cmake should use pkgconfig information instead of a hard coded...
authorbjcollins <brent.collins.83@gmail.com>
Fri, 27 Jun 2014 19:46:27 +0000 (14:46 -0500)
committerbjcollins <brent.collins.83@gmail.com>
Fri, 27 Jun 2014 19:46:27 +0000 (14:46 -0500)
the OnOpen callback should be called when set to avoid a segfault.

channels/drdynvc/client/dvcman.c
channels/tsmf/client/tsmf_main.c
cmake/FindGlib.cmake

index bd3718a..a29e550 100644 (file)
@@ -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;
index ec0426f..e6fd205 100644 (file)
@@ -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;
index 3e22eb0..8005ce1 100644 (file)
@@ -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.