Changes in / [8d182b1:5625427]


Ignore:
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/coroutine.cfa

    r8d182b1 r5625427  
    318318void defaultResumeAtHandler( exception_t * except ) {
    319319    __cfaehm_allocate_exception( except );
     320    free( except );
    320321    __cfaehm_begin_unwind( (void(*)(exception_t *))defaultTerminationHandler );
    321322}
    322 
    323 struct ehm_cleanup {
    324         exception_t * ex;
    325 };
    326 
    327 void ^?{}( ehm_cleanup & this ) { free( this.ex ); }
    328323
    329324bool poll( coroutine$ * cor ) libcfa_public {
     
    335330    // otherwise loop and throwResume all pending exceptions
    336331    while ( nl_ex != 0p ){
    337                 ehm_cleanup ex_holder{ nl_ex->the_exception };
     332        exception_t * ex = nl_ex->the_exception;
    338333        free( nl_ex );
    339         __cfaehm_throw_resume( ex_holder.ex , defaultResumeAtHandler );
     334        __cfaehm_throw_resume( ex, defaultResumeAtHandler );
    340335       
     336        // only reached if resumption handled. other dealloc handled in defaultResumeAtHandler
     337        free( ex );
    341338        nl_ex = pop_ehm_head( cor );
    342339    }
Note: See TracChangeset for help on using the changeset viewer.