[Vala] Memory leak in async dbus calls



Hello list,

compiling this min vala test file I got code that calls 

_data_ = g_slice_new0 (testDBusProxySetLedData);  

in test_dbus_proxy_set_led_async which is never freeed nor has the 

dbus_pending_call_set_notify (_pending, test_dbus_proxy_set_led_ready,
_data_, NULL);

a valid DBusFreeFunction (param 4: NULL). 

What I am missing is a line like:

g_slice_free(testDBusProxySetLedData, _data_); 

At the end of the following function:

static void test_dbus_proxy_set_led_ready (DBusPendingCall* pending,
void* user_data) {
        testDBusProxySetLedData* _data_;
        _data_ = user_data;
        g_simple_async_result_complete (g_simple_async_result_new
(g_object_newv (G_TYPE_OBJECT, 0, NULL), _data_->_callback_,
_data_->_user_data_, _data_));

        // freeing user date here ?     
}

This seems to be the reason for my memory leak. 

Is it possible to work around or to get a fix soon?

Best Regards - Sascha Dierberg
----------------------------------- bug.vala
------------------------------
using DBus;
using GLib;

[DBus (name = "de.dresearch.hip.test")]
public interface test : GLib.Object 
{
        public abstract async void set_led(uint color) throws
DBus.Error;
}

----------------------------------- bug.vala
------------------------------
--
Sascha Dierberg, Senior Software Engineer DResearch Digital Media 
Systems GmbH Otto-Schmirgal-Str 3, 10319 Berlin
Tel: +49 (30) 515932 226
Fax: +49 (30) 515932 299 mailto:dierberg dresearch de 
http://www.dresearch.de DResearch Digital Media Systems GmbH, 
Amtsgericht: Berlin Charlottenburg, HRB:54412 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]