From ceb4347250d8394a2b4f5d1e634b42532f34c7d1 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 12 Oct 2011 00:03:58 -0700 Subject: Forgot mingw32-config.h. Also fixed a couple of bugs: WSAStartup has to be called in win32 at startup. The TLS environment needs to be cleared when created. --- includes/Local.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/Local.h b/includes/Local.h index 79862a6..6a598ab 100644 --- a/includes/Local.h +++ b/includes/Local.h @@ -26,14 +26,14 @@ class Local : public AtStart { void set(void * obj) { void * r = getTLS(); if (r) setLocal(obj); else setGlobal(obj); } int getIndex() { return m_idx; } private: - static void * create() { void * r = malloc(s_size * sizeof(void *)); return r; } + static void * create() { void * r = calloc(s_size * sizeof(void *), 1); return r; } static void * getTLS() { return g_tlsManager->getTLS(); } static void * setTLS(void * val) { return g_tlsManager->setTLS(val); } virtual void doStart(); int m_idx; static int s_size; static void ** m_globals; - + friend class TLSManager; }; -- cgit v1.2.3