From 3f855f07f5d2e9a08a586436719358c40a46f29d Mon Sep 17 00:00:00 2001 From: TingPing Date: Sun, 28 Dec 2014 06:08:20 -0500 Subject: Use glib for allocations in all plugins Continuation of 83032b1aa --- plugins/doat/Makefile.am | 4 ++-- plugins/doat/doat.c | 16 ++++++---------- plugins/doat/doat.vcxproj | 8 ++++++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'plugins/doat') diff --git a/plugins/doat/Makefile.am b/plugins/doat/Makefile.am index 10b38cc6..a04d2863 100644 --- a/plugins/doat/Makefile.am +++ b/plugins/doat/Makefile.am @@ -3,6 +3,6 @@ libdir = $(hexchatlibdir) lib_LTLIBRARIES = doat.la doat_la_SOURCES = doat.c doat_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module -doat_la_LIBADD = -doat_la_CFLAGS = -I$(top_srcdir)/src/common +doat_la_LIBADD = $(GLIB_LIBS) +doat_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common diff --git a/plugins/doat/doat.c b/plugins/doat/doat.c index 5e0aa4eb..1d1bfcdf 100644 --- a/plugins/doat/doat.c +++ b/plugins/doat/doat.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "hexchat-plugin.h" static hexchat_plugin *ph; @@ -33,7 +34,7 @@ parse_command( char *word[], char *word_eol[], void *userdata ) { break; } - channel = strdup( token ); + channel = g_strdup( token ); delimiter = strchr( channel, '/' ); @@ -42,13 +43,13 @@ parse_command( char *word[], char *word_eol[], void *userdata ) { *delimiter = '\0'; if( strlen( delimiter + 1 ) > 0 ) { - server = strdup( delimiter + 1 ); + server = g_strdup( delimiter + 1 ); } } /* /Network form */ if( strlen( channel ) == 0 ) { - free( channel ); + g_free( channel ); channel = NULL; } @@ -60,13 +61,8 @@ parse_command( char *word[], char *word_eol[], void *userdata ) { } } - if( channel != NULL ) { - free( channel ); - } - - if( server != NULL ) { - free( server ); - } + g_free( channel ); + g_free( server ); } } return HEXCHAT_EAT_HEXCHAT; diff --git a/plugins/doat/doat.vcxproj b/plugins/doat/doat.vcxproj index 171e2b0d..86c80f09 100644 --- a/plugins/doat/doat.vcxproj +++ b/plugins/doat/doat.vcxproj @@ -62,7 +62,7 @@ true true WIN32;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions) - ..\..\src\common;%(AdditionalIncludeDirectories) + ..\..\src\common;$(Glib);%(AdditionalIncludeDirectories) true @@ -70,6 +70,8 @@ true true true + $(DepsRoot)\lib;%(AdditionalLibraryDirectories) + $(DepLibs);%(AdditionalDependencies) doat.def @@ -80,7 +82,7 @@ true true WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions) - ..\..\src\common;%(AdditionalIncludeDirectories) + ..\..\src\common;$(Glib);%(AdditionalIncludeDirectories) true @@ -88,6 +90,8 @@ true true true + $(DepsRoot)\lib;%(AdditionalLibraryDirectories) + $(DepLibs);%(AdditionalDependencies) doat.def -- cgit 1.4.1