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 ); } }