Changeset 5151:2f26230719b5 in roaraudio


Ignore:
Timestamp:
10/15/11 15:41:15 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

use fresh error context for each notify callback.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/notify.c

    r5019 r5151  
    272272int roar_notify_core_emit(struct roar_notify_core * core, struct roar_event * event) { 
    273273 struct roar_subscriber * cur; 
     274 struct roar_error_state errstate; 
    274275 
    275276 _CKICORE(); 
     
    303304   ROAR_ERR("roar_notify_core_emit(core=%p, event=%p): cur=%p, cb is set NULL, bad.", core, event, cur); 
    304305  } else { 
     306   // The callback is started in an clear error context which is destroyed after it finished so it 
     307   // does not alter our caller's context. 
     308   roar_err_store(&errstate); 
     309   roar_err_clear_all(); 
     310 
    305311   cur->cb(core, event, cur->userdata); 
     312 
     313   roar_err_restore(&errstate); 
    306314  } 
    307315  cur = cur->next; 
Note: See TracChangeset for help on using the changeset viewer.