From cd4786166a6d02d22f48060f1e1cb2c97560c3c7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 6 Mar 2009 23:27:19 +0000 Subject: [PATCH] - client: fix crash svn path=/trunk/boinc/; revision=17550 --- checkin_notes | 5 +++++ lib/coproc.h | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 9e161deaab..26b88ced95 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2870,3 +2870,8 @@ David 6 Mar 2009 client_types.h lib/ coproc.h + +David 6 Mar 2009 + - client: fix crash + lib/ + coproc.h diff --git a/lib/coproc.h b/lib/coproc.h index 8aac50a26b..b88b54c387 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -49,12 +49,22 @@ struct COPROC { #ifndef _USING_FCGI_ virtual void write_xml(MIOFILE&); #endif + inline void clear() { + // can't just memcpy() - trashes vtable + type[0] = 0; + count = 0; + used = 0; + req_secs = 0; + req_instances = 0; + estimated_delay = 0; + memset(owner, 0, sizeof(owner)); + } COPROC(const char* t){ - memset(this, 0, sizeof(COPROC)); + clear(); strcpy(type, t); } COPROC() { - memset(this, 0, sizeof(COPROC)); + clear(); } virtual ~COPROC(){} int parse(MIOFILE&);