| Message: 19054 |
 |
BY: Jan Wedekind (wedesoft) DATE: 2007-03-11 14:27 SUBJECT: Memory-leak in Qt::ByteArray? I would like to use qt4-ruby for displaying videos. However there seems to be a memory leak in Qt::ByteArray. I've done some testing with the following program (commenting out Qt::Pixmap, commenting out Qt::ByteArray):
require 'RMagick'
require 'Qt'
app=Qt::Application.new(ARGV)
class VideoWidget < Qt::Label
def initialize( parent = nil )
super
startTimer( 0 )
@str = Magick::Image.read("safety.gif")[0].to_blob { self.format = "PPM" }
end
def timerEvent( e )
pix = Qt::Pixmap.new
pix.loadFromData( Qt::ByteArray.fromRawData( @str, @str.size ) )
setPixmap( pix )
resize( pix.width, pix.height )
update
GC.start
end
end
win = VideoWidget.new
win.show
app.exec
Also see http://rubyforge.org/forum/forum.php?forum_id=12790 | |