]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix simple scan reinit options
authorBastian Dehn <hhaalo@arcor.de>
Tue, 24 Dec 2024 08:50:36 +0000 (09:50 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 24 Dec 2024 08:50:36 +0000 (09:50 +0100)
src/kds_s2000w_net.c
tests/kds_s2000w_net_tests.c

index eb5731e59cf165c4127b21fb8de0998ec55f76bc..6fa9159ae941dcfe81adb1a0cfec8c2dd0a6066e 100644 (file)
@@ -46,7 +46,6 @@ SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback
 #endif
 
        *version_code = SANE_VERSION_CODE(MAJOR, MINOR, PATCH);
-       kds_s2000w_option_descriptor_init_option_descriptors();
 
        return SANE_STATUS_GOOD;
 }
@@ -91,6 +90,7 @@ SANE_Status _sane_kds_s2000w_net_open(SANE_String_Const devicename,
        if (strcmp(devicename, "kds_s2000w_net") != 0)
                return SANE_STATUS_INVAL;
 
+       kds_s2000w_option_descriptor_init_option_descriptors();
        kds_s2000w_handler_open(devicename, handle);
        handler* h = (handler*) *handle;
        if (h->state == BUSY)
index 271578ff6d37c72c8e8f620fb117d545773648c3..0796e54e9085b8e36111e112958fb870d0699bdd 100644 (file)
@@ -5,6 +5,7 @@
 #include "kds_s2000w_client_mock.h"
 #include "../src/kds_s2000w_config.h"
 #include "../src/kds_s2000w_net.h"
+#include "../src/kds_s2000w_option_descriptors.h"
 #include "../src/kds_s2000w_handler.h"
 #include "../src/kds_s2000w_image_converter.h"
 
@@ -432,6 +433,7 @@ void sane_kds_s2000w_net_open()
        assert_int_equal(h->sessionid, 1251877821);
        assert_int_equal(status, SANE_STATUS_GOOD);
 
+       kds_s2000w_option_descriptor_free_option_descriptors();
        free_handler(h);
        h = NULL;
        kds_s2000w_client_response_free(resp);
@@ -456,6 +458,7 @@ void sane_kds_s2000w_net_open_busy_device()
        assert_int_equal(h->state, BUSY);
        assert_int_equal(status, SANE_STATUS_DEVICE_BUSY);
 
+       kds_s2000w_option_descriptor_free_option_descriptors();
        free_handler(h);
        h = NULL;
        kds_s2000w_client_response_free(resp);