<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 14/07/2014 14:27, Philip Withnall
wrote:<br>
</div>
<blockquote
cite="mid:1405340846.1957.6.camel@philip-work-laptop.cbg.collabora.co.uk"
type="cite">
<pre wrap="">
You can still implement your own reference counting for the user_data.
If it is a struct, just add a new member:
volatile int ref_count;
and thread-safe ref and unref functions:
MyStruct *my_struct_ref (MyStruct *self) {
g_atomic_int_inc (&self->ref_count);
return self;
}
and:
void my_struct_unref (MyStruct *self) {
if (g_atomic_int_dec_and_test (&self->ref_count)) {
/* Free the structure here. */
}
}
</pre>
</blockquote>
To implement this I need two points inside the the code runned by
the main loop thread in which change the reference count and check
for destruction.<br>
Can I use change state <span style="color: rgb(0, 0, 0);
font-family: monospace; font-size: medium; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;
display: inline !important; float: none; background-color:
rgb(255, 255, 255);">NICE_COMPONENT_STATE_GATHERING </span>to
increase ref_count<br>
and <br>
streams-removed to decrease it?<br>
Please give me a suggestion.<br>
<br>
Thank you,<br>
<br>
Emanuele<br>
</body>
</html>