Created attachment 501 [details] Proposed patch Currently, if the analog output module is explicitly requested in sigrok-cli using the "-O analog" option, the program does not exit cleanly and instead it produces a g_variant_unref() assertion failure. This is because sigrok-cli attempts to clean the analog output module twice: sr_output_free() is called twice in session.c. The proposed patch makes sure that the analog output module is not cleaned up more than once, even if the sr_output_free() function is called more than once. The same check is applied to the other output modules for consistency. A few GVariant instances are also properly unreferenced in other output modules by the proposed patch, so that the memory is freed. This bug is fixed here: https://github.com/sigrokproject/libsigrok/pull/17/commits/435e369246de6d3534fe6df25ecf386d3fa62c07