From e7bf22f5fdfacbb6e51f31c42517d799512f21f2 Mon Sep 17 00:00:00 2001 From: Zhijiang TAO Date: Fri, 18 Nov 2016 22:48:14 +0800 Subject: [PATCH] non-shared stack should be free when co_routine release --- co_routine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/co_routine.cpp b/co_routine.cpp index 810ed22..06b9d84 100644 --- a/co_routine.cpp +++ b/co_routine.cpp @@ -520,13 +520,15 @@ int co_create( stCoRoutine_t **ppco,const stCoRoutineAttr_t *attr,pfn_co_routine } void co_free( stCoRoutine_t *co ) { + if( co && co->cIsShareStack ) + free( co->stack_mem ); free( co ); } void co_release( stCoRoutine_t *co ) { if( co->cEnd ) { - free( co ); + co_free( co ); } }