Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
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


Thread View

Thread Author Date
Memory-leak in Qt::ByteArray?Jan Wedekind2007-03-11 14:27
      RE: Memory-leak in Qt::ByteArray?Richard Dale2007-03-12 14:01
            RE: Memory-leak in Qt::ByteArray?Jan Wedekind2007-03-12 14:24
                  RE: Memory-leak in Qt::ByteArray?Richard Dale2007-03-12 14:50
                        RE: Memory-leak in Qt::ByteArray?Jan Wedekind2007-03-12 16:59
                        RE: Memory-leak in Qt::ByteArray?Jan Wedekind2007-03-12 18:03
                              RE: Memory-leak in Qt::ByteArray?Richard Dale2007-03-12 23:03
                                    RE: Memory-leak in Qt::ByteArray?Jan Wedekind2007-03-13 06:26
                                          RE: Memory-leak in Qt::ByteArray?Richard Dale2007-03-13 06:57

Post a followup to this message