]> sigrok.org Git - libsigrokdecode.git/commitdiff
get_current_pinvalues(): Slightly simplify a code chunk.
authorUwe Hermann <redacted>
Tue, 15 May 2018 20:29:49 +0000 (22:29 +0200)
committerUwe Hermann <redacted>
Tue, 15 May 2018 20:30:35 +0000 (22:30 +0200)
type_decoder.c

index 16e25a7b92f8885dd22f11fb344cb30b9cd98d2c..a01d7852ae85f5e26f35ba8a03733749f89f014b 100644 (file)
@@ -518,14 +518,13 @@ static PyObject *get_current_pinvalues(const struct srd_decoder_inst *di)
        PyObject *py_pinvalues;
        PyGILState_STATE gstate;
 
-       gstate = PyGILState_Ensure();
-
        if (!di) {
                srd_err("Invalid decoder instance.");
-               PyGILState_Release(gstate);
                return NULL;
        }
 
+       gstate = PyGILState_Ensure();
+
        py_pinvalues = PyTuple_New(di->dec_num_channels);
 
        for (i = 0; i < di->dec_num_channels; i++) {