« Return to Thread: Debian lenny and svn opensync

[PATCH] Define HANDLE_LIBICAL_MEMORY to avoid compiler warning.

by Chris Frey-2 :: Rate this Message:

Reply to Author | View in Thread

This patch does nothing to handle actual memory freeing, so leaks
may be introduced here... it may help avoid crashes though.
---

I decided to turn on all compiler warnings and try to fix everything that
popped up.  This patch ended up making my evolution plugin test runs
MUCH smoother! :-)

In my Debian Lenny system, the evolution-data-server packages install
/usr/include/evolution-data-server-2.22/libical/ical.h, which contains
the following code at the end:

        #ifndef HANDLE_LIBICAL_MEMORY
        #warning "Please ensure that the memory returned by the functions mentioned at http://bugzilla.gnome.org/show_bug.cgi?id=516408#c1 are free'ed"
        #endif

        #define LIBICAL_MEMFIXES 1

If this change is not supported in the plugin, then according to the
URL above, there's a ring buffer that's freed internally in libical, and
this would explain my near random crash behaviour.

- Chris


 src/evolution2_sync.h |    4 ++++
 tools/list_sources.c  |    4 ++++
 tools/test_uri.c      |    4 ++++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/evolution2_sync.h b/src/evolution2_sync.h
index 22deb72..d7cabf2 100644
--- a/src/evolution2_sync.h
+++ b/src/evolution2_sync.h
@@ -3,6 +3,10 @@
 
 //#include "evo2_sync.h"
 
+#ifndef HANDLE_LIBICAL_MEMORY
+#define HANDLE_LIBICAL_MEMORY 1
+#endif
+
 #include <opensync/opensync.h>
 
 #include <libecal/e-cal.h>
diff --git a/tools/list_sources.c b/tools/list_sources.c
index fb25499..ddebf90 100644
--- a/tools/list_sources.c
+++ b/tools/list_sources.c
@@ -1,3 +1,7 @@
+#ifndef HANDLE_LIBICAL_MEMORY
+#define HANDLE_LIBICAL_MEMORY 1
+#endif
+
 #include <glib.h>
 #include <libecal/e-cal.h>
 #include <libebook/e-book.h>
diff --git a/tools/test_uri.c b/tools/test_uri.c
index 476a6b0..f9a0922 100644
--- a/tools/test_uri.c
+++ b/tools/test_uri.c
@@ -1,3 +1,7 @@
+#ifndef HANDLE_LIBICAL_MEMORY
+#define HANDLE_LIBICAL_MEMORY 1
+#endif
+
 #include <string.h>
 #include <glib.h>
 #include <libecal/e-cal.h>
--
1.6.2.1


------------------------------------------------------------------------------
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

 « Return to Thread: Debian lenny and svn opensync