<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
I have a problem with emitting of the following signal:<br>
<br>
<signal name="mySignal"><br>
<arg type="s" name="paramName" direction="out"/><br>
<arg type="s" name="group" direction="out"/><br>
<arg type="v" name="paramDetails" direction="out"/><br>
</signal><br>
<br>
the code (myInterface_if_emit_my_signal) has been generated with
gdbus-codegen ( glib-2.32.0 )<br>
<br>
I am working on SLES 11. <br>
<br>
Following source code illustrates the problem<br>
<br>
<tt>... </tt><tt><br>
</tt><tt>GVariant *arr[GVARIANT_GEN_SIZE];</tt><tt><br>
</tt><tt>int cnt = 0;</tt><tt><br>
</tt><tt><br>
</tt><tt>if( </tt><tt><b>condition</b></tt><tt> )</tt><tt><br>
</tt><tt>{</tt><tt><br>
</tt><tt> arr[cnt++] = g_variant_new_boolean( aBoolValue );</tt><tt><br>
</tt><tt> ....</tt><tt><br>
</tt><tt> arr[cnt++] = g_variant_new_xxx( xxxValue );</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt><br>
</tt><tt>GVariant *gv = g_variant_new_variant(
g_variant_new_tuple(arr, cnt) );</tt><tt><br>
</tt><tt><br>
</tt><tt>myInterface_if_emit_my_signal( "string1", "string2", gv );</tt><tt><br>
</tt><tt>....</tt><br>
<br>
As long as the <b>condition</b> is true, everything works
perfectly. <br>
<br>
In case that the <b>condition</b> is false, the unit tuple shall be
constructed (cnt == 0) - the g-variant-new-tuple description states:<br>
"If <em class="parameter"><code>n_children</code></em> is 0 then
the unit tuple is constructed"<br>
<br>
Emitting the signal with such a unit tuple causes the application
crash.<br>
<br>
Is this a "feature", bug or my mistake? How to resolve this?<br>
<br>
thank you for your help,<br>
<br>
with best regards<br>
<br>
<div class="moz-signature">-- <br>
<p><b>Bogdan Lotko</b></p>
<a class="moz-txt-link-abbreviated"
href="mailto:b.lotko@chello.at">b.lotko@chello.at</a>
<br>
Phone: +43 1 2852458
<br>
Mobile: +43 676 6615012
</div>
</body>
</html>