Memory Leak in Gio::FileInputStream



Hi Guys,

I've found a memory Leak in Giomm 2.4 (The version one can install from Synaptics in Linux Mint 14)  64-Bit version.

Minimum Example:


#include <giomm.h>
#include <gtkmm.h>
#include <iostream>

int main(int argc, char** argv)
{
  Gtk::Main main(argc, argv);

  try
  {
    Glib::RefPtr<Gio::File> file = Gio::File::create_for_path("/path/to/existing/file");

    while(1)
    {

      Glib::RefPtr<Gio::FileInputStream> stream = file->read();
      stream->close();
      stream.clear();
    }
  }catch(const Glib::Exception& e)
  {
    std::cout<<"Exception:\n"<<e.what()<<"\n";
    return 23;
  }

  return 0;
}



"/path/to/existing/file" must be a path to an existing file ;)
Just run this sample and watch in the system Monitor the usage of memory raise.

greetings, Robert


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