Logo Search packages:      
Sourcecode: zebra version File versions  Download package

void zebra_processor_destroy ( zebra_processor_t processor  ) 

destructor. cleans up all resources associated with the processor

Definition at line 422 of file processor.c.

References zebra_image_scanner_destroy(), zebra_processor_destroy(), zebra_video_destroy(), and zebra_window_destroy().

Referenced by zebra_processor_destroy().

{
    (void)proc_lock(proc);
    proc_destroy_thread(proc->video_thread, &proc->video_started);
    proc_destroy_thread(proc->input_thread, &proc->input_started);
    if(proc->window) {
        zebra_window_destroy(proc->window);
        proc->window = NULL;
        _zebra_window_close(proc);
    }
    if(proc->video) {
        zebra_video_destroy(proc->video);
        proc->video = NULL;
    }
    if(proc->scanner) {
        zebra_image_scanner_destroy(proc->scanner);
        proc->scanner = NULL;
    }
    proc_unlock(proc);
    err_cleanup(&proc->err);
#ifdef HAVE_LIBPTHREAD
    pthread_cond_destroy(&proc->event);
    pthread_cond_destroy(&proc->cond);
    pthread_mutex_destroy(&proc->mutex);
#endif
    if(proc->polling.fds) {
        free(proc->polling.fds);
        proc->polling.fds = NULL;
    }
    if(proc->polling.handlers) {
        free(proc->polling.handlers);
        proc->polling.handlers = NULL;
    }
    if(proc->thr_polling.fds) {
        free(proc->thr_polling.fds);
        proc->thr_polling.fds = NULL;
    }
    if(proc->thr_polling.handlers) {
        free(proc->thr_polling.handlers);
        proc->thr_polling.handlers = NULL;
    }
    free(proc);
}


Generated by  Doxygen 1.6.0   Back to index