From d69b1e834cc1558ff117688da7030dabd22099fa Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 23 Feb 2011 09:24:44 +0100 Subject: Do something meaningful and check for frame grabber library --- src/uca.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/uca.c') diff --git a/src/uca.c b/src/uca.c index 3549e60..af934c8 100644 --- a/src/uca.c +++ b/src/uca.c @@ -33,7 +33,7 @@ struct uca_t *uca_init() int i = 0; while (inits[i] != NULL) { uca_cam_init init = inits[i]; - if (init(uca)) + if (init(uca) != UCA_ERR_INIT_NOT_FOUND) return uca; i++; } @@ -45,6 +45,8 @@ struct uca_t *uca_init() void uca_destroy(struct uca_t *uca) { - uca->cam_destroy(uca); - free(uca); + if (uca != NULL) { + uca->cam_destroy(uca); + free(uca); + } } -- cgit v1.2.3