示例#1
0
static void
scanner_dealloc (zbarScanner *self)
{
    scanner_clear(self);
    zbar_scanner_destroy(self->zscn);
    ((PyObject*)self)->ob_type->tp_free((PyObject*)self);
}
示例#2
0
void zbar_image_scanner_destroy (zbar_image_scanner_t *iscn)
{
	dump_stats(iscn);
	if(iscn->syms) {
		if(iscn->syms->refcnt)
			zbar_symbol_set_ref(iscn->syms, -1);
		else
			_zbar_symbol_set_free(iscn->syms);
		iscn->syms = NULL;
	}
	if(iscn->scn)
		zbar_scanner_destroy(iscn->scn);
	iscn->scn = NULL;
	if(iscn->dcode)
		zbar_decoder_destroy(iscn->dcode);
	iscn->dcode = NULL;
	int i;
	for(i = 0; i < RECYCLE_BUCKETS; i++) {
		zbar_symbol_t *sym, *next;
		for(sym = iscn->recycle[i].head; sym; sym = next) {
			next = sym->next;
			_zbar_symbol_free(sym);
		}
	}
#ifdef ENABLE_QRCODE
	if(iscn->qr) {
		_zbar_qr_destroy(iscn->qr);
		iscn->qr = NULL;
	}
#endif
	free(iscn);
}
示例#3
0
void zbar_image_scanner_destroy (zbar_image_scanner_t *iscn)
{
    if(iscn->scn)
        zbar_scanner_destroy(iscn->scn);
    iscn->scn = NULL;
    if(iscn->dcode)
        zbar_decoder_destroy(iscn->dcode);
    iscn->dcode = NULL;
    while(iscn->syms) {
        zbar_symbol_t *next = iscn->syms->next;
        sym_destroy(iscn->syms);
        iscn->syms = next;
    }
    free(iscn);
}