[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bindings
Subject: Re: [Kde-bindings] QtRuby memleak continued
From: Richard Dale <rdale () foton ! es>
Date: 2006-09-01 11:08:43
Message-ID: 200609011208.43570.rdale () foton ! es
[Download RAW message or body]
On Thursday 31 August 2006 13:27, Caleb Tennis wrote:
> As a bonus:
>
> The memory leak in the marshall_QString is occurring on a signal/slot
> connected like this:
>
> connect(o1, SIGNAL('sig(QString &)'), o2, SLOT('slt(QString &)') )
>
> The leak goes away when I change both of those to "const QString &".
> Changing them to just "QString" and the leak seems to persist.
Well the code to delete the QString has these rules, which seem a bit
arbitrary:
fromVALUE (ie Ruby to C++):
if(s && m->type().isConst() && m->cleanup())
delete s;
ToVALUE (ie C++ to Ruby):
if(m->cleanup() || m->type().isStack())
delete s;
So I assume in you example 'slt(QString &)' is a C++ slot, and you are
emitting the signal in Ruby? Then the code in fromVALUE would be wrong and
shouldn't have the 'isConst()' test.
-- Richard
_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic