Gtkmm-forge Digest, Vol 8, Issue 7



Send Gtkmm-forge mailing list submissions to
	gtkmm-forge lists sourceforge net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/gtkmm-forge
or, via email, send a message with subject or body 'help' to
	gtkmm-forge-request lists sourceforge net

You can reach the person managing the list at
	gtkmm-forge-owner lists sourceforge net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gtkmm-forge digest..."


gtkmm-forge is the mailing list that receives gtkmm bug reports from bugzilla.  A daily digest is sent to gtkmm-main, to encourage people to help fixing the bugs. Do not try to unsubscribe gtkmm-forge from gtkmm-list.


Today's Topics:

   1. [Bug 394686] New: Started to wrap GdaQuery and its
      dependencies (gnomemm (bugzilla.gnome.org))
   2. [Bug 394686] Started to wrap GdaQuery and its	dependencies
      (gnomemm (bugzilla.gnome.org))
   3. [Bug 394907] New: delete the class which inherit	from gtk has
      some memory leak. (gtkmm (bugzilla.gnome.org))
   4. [Bug 394686] Started to wrap GdaQuery and its	dependencies
      (gnomemm (bugzilla.gnome.org))


----------------------------------------------------------------------

Message: 1
Date: Tue,  9 Jan 2007 16:23:24 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 394686] New: Started to wrap GdaQuery
	and its	dependencies
To: gtkmm-forge lists sourceforge net
Message-ID: <bug-394686-5595 http bugzilla gnome org/>
Content-Type: text/plain; charset=utf-8

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=394686

  gnomemm | libgdamm | Ver: unspecified

           Summary: Started to wrap GdaQuery and its dependencies
           Product: gnomemm
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: libgdamm
        AssignedTo: gtkmm-forge lists sourceforge net
        ReportedBy: armin arbur net
         QAContact: gtkmm-forge lists sourceforge net
                CC: jhs cvs gnome org
     GNOME version: Unspecified
   GNOME milestone: Unspecified


This patch wraps GdaReferer, GdaRenderer, GdaXmlStorage, GdaQueryObject and
parts of GdaQuery.


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email



------------------------------

Message: 2
Date: Tue,  9 Jan 2007 16:24:30 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 394686] Started to wrap GdaQuery and
	its	dependencies
To: gtkmm-forge lists sourceforge net
Message-ID: <20070109162430 BE14D6C4105 box gnome org>
Content-Type: text/plain; charset=utf-8

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=394686

  gnomemm | libgdamm | Ver: unspecified





------- Comment #1 from Armin Burgmeier  2007-01-09 16:22 UTC -------
Created an attachment (id=79856)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=79856&action=view)
Patch wrapping GdaQuery and dependencies


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email



------------------------------

Message: 3
Date: Wed, 10 Jan 2007 02:33:35 +0000 (UTC)
From: "gtkmm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 394907] New: delete the class which
	inherit	from gtk has some memory leak.
To: gtkmm-forge lists sourceforge net
Message-ID: <bug-394907-5595 http bugzilla gnome org/>
Content-Type: text/plain; charset=utf-8

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=394907

  gtkmm | general | Ver: 2.8.x

           Summary: delete the class which inherit from gtk has some memory
                    leak.
           Product: gtkmm
           Version: 2.8.x
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: critical
          Priority: Normal
         Component: general
        AssignedTo: gtkmm-forge lists sourceforge net
        ReportedBy: simonwan linpus com
         QAContact: gtkmm-forge lists sourceforge net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Please describe the problem:
I am a newly programmer of glibmm . I wrote some picture button widget for
media center application.But it has serious memory leak. then I worte a test
program to simulate the case of my programe, the leak problem still has.
Following section is my test program and library version which I used. Whether
is the glibmm's bug or my incorrect using of glibmm?
Any adivce is appreciate. Thanks very much! :)


linux-fusion    3.0
DirectFB        0.9.25
pkg-config      0.20
glib            2.10.2
ATK             1.10.3
cairo           1.0.2
Pango           1.12.2
GTK+(/DFB)      2.8.10
Libsigc++       2.0.17
glibmm          2.8.7
Gtkmm           2.8.7

/* compiler.sh */
#!/bin/sh

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/gtkdfb/lib/pkgconfig"
export LD_LIBRARY_PATH="/usr/local/lib/:/usr/gtkdfb/lib/"

rm testpv -rf
rm pagevideo.o -rf
rm examplewindow.o -rf

g++ -c pagevideo.cc `pkg-config gtkmm-2.4 --cflags`
g++ -c examplewindow.cc `pkg-config gtkmm-2.4 --cflags`

g++ main.cc -o testpv pagevideo.o examplewindow.o `pkg-config gtkmm-2.4
--cflags --libs` -DREENTRANT -O3 -fexpensive-optimizations -ffast-math -Wall
-g0 -L/usr/gtkdfb/lib  



/* pagevideo.h */
#ifndef _PAGEVIDEO_H_
#define _PAGEVIDEO_H_
#include <glibmm.h>
#include <gtkmm.h>
#include <gdkmm.h>
using namespace Gtk;
using namespace Glib;
using namespace Gdk;

typedef sigc::signal<void, int> MEVENT_PAGEBTN;

class MPageVideo:public Gtk::Fixed
{
  private:
    bool OnButtonKeyPress(GdkEventKey *ev);
    bool OnButtonPress(GdkEventButton *ev);
    bool on_mdrawArea_expose_event(GdkEventExpose *ev);
  private:

    DrawingArea * mdrawArea;
    EventBox    * meventBox;

    MEVENT_PAGEBTN m_signal;

    int mLeft;
    int mTop;
    int mWidth;
    int mHeight;
    int mpieces;
  public:
    MEVENT_PAGEBTN signal_something();
    void showbg();
    void hide();
    void show();
    MPageVideo();
    ~MPageVideo();
};


/* pagevideo.cc */

#include <time.h>
#include <sys/timeb.h>

#include "pagevideo.h"

MPageVideo::MPageVideo()
{
  mWidth = 273;
  mpieces = 1;
  mHeight = 47;
  mLeft = 0;
  mTop = 196;

  meventBox = new class Gtk::EventBox();
  mdrawArea = new class Gtk::DrawingArea();

  mdrawArea->set_size_request(mWidth/mpieces, mHeight);
  meventBox->set_flags(Gtk::CAN_FOCUS);
  meventBox->set_size_request(mWidth/mpieces, mHeight);
  meventBox->add(*mdrawArea);
  put (*meventBox, mLeft, mTop);

  mdrawArea->add_events(ALL_EVENTS_MASK);

  /* user click/press the meventBox to notify the app which use the pagevideo
class to delete it */
  meventBox->signal_button_press_event().connect (sigc::mem_fun(*this,
&MPageVideo::OnButtonPress));
  meventBox->signal_key_release_event().connect (sigc::mem_fun(*this,
&MPageVideo::OnButtonKeyPress), false);
  mdrawArea->signal_expose_event().connect(sigc::mem_fun(*this,
&MPageVideo::on_mdrawArea_expose_event), false);
  meventBox->signal_expose_event().connect(sigc::mem_fun(*this,
&MPageVideo::on_mdrawArea_expose_event), false);
  meventBox->show();
  mdrawArea->show();
  meventBox->grab_focus();

}

MEVENT_PAGEBTN MPageVideo::signal_something()
{
  return m_signal;
}

bool MPageVideo::on_mdrawArea_expose_event(GdkEventExpose *ev)
{
  RefPtr<Gdk::GC> gc;
  RefPtr<Gdk::Window> mwindow;

  mwindow = mdrawArea->get_window();
  gc = Gdk::GC::create(mwindow);
  mwindow->draw_line(gc, 1, 1, 150, 1);
  mwindow->draw_line(gc, 1, 20, 150, 20);
  mwindow->draw_line(gc, 1, 1, 1, 20);
  mwindow->draw_line(gc, 150,1 , 150, 20);

  return true;
}

bool MPageVideo::OnButtonPress(GdkEventButton *ev)
{

  hide();
  m_signal.emit(1);
  return true;

}

void MPageVideo::showbg()
{
}

void MPageVideo::hide()
{
  Fixed::hide();
}
void MPageVideo::show()
{
  Fixed::show();
  meventBox->show();
  mdrawArea->show();
}

bool MPageVideo::OnButtonKeyPress(GdkEventKey *ev)
{
  hide();
  m_signal.emit (1);
  return true;
}

MPageVideo::~MPageVideo()
{
/*
  meventBox->remove();
  Gtk::Container::remove (*meventBox);
 */
  delete meventBox;
  delete mdrawArea;
}


/* examplewindow.h */#ifndef GTKMM_EXAMPLEWINDOW_H
#define GTKMM_EXAMPLEWINDOW_H

#include <gtkmm.h>
#include "pagevideo.h"

class ExampleWindow : public Gtk::Window
{
public:
  ExampleWindow();
  virtual ~ExampleWindow();

protected:
  //Signal handlers:
  virtual void on_button_quit();
  virtual void on_button_test();
          void on_page_close(int val);

  //Child widgets:
  Gtk::VBox m_VBox;
  int press_count;
  MPageVideo *PageVideo;
  Gtk::HButtonBox m_ButtonBox;
  Gtk::Table m_Table; 
  Gtk::Button m_Button_Quit;
  Gtk::Button m_Button_Test;
  Gtk::Notebook notebook;
  class Gtk::Alignment m_align;

};

#endif //GTKMM_EXAMPLEWINDOW_H


/* examplewindow.cc */

#include <iostream>
#include "examplewindow.h"

ExampleWindow::ExampleWindow()
  : m_Button_Quit("Quit"),
  m_Button_Test("Test"),
  m_align(Gtk::ALIGN_LEFT, Gtk::ALIGN_TOP, 0.0, 0.0)
{
  set_title("Custom Container example");
  set_border_width(6);
  set_default_size(800, 600);
  press_count = 0;
  add(m_VBox);
  notebook.append_page (m_align);
  m_VBox.pack_start(notebook, Gtk::PACK_EXPAND_WIDGET);
  m_VBox.pack_start(m_ButtonBox, Gtk::PACK_SHRINK);

  m_ButtonBox.pack_start(m_Button_Test, Gtk::PACK_SHRINK);
  m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);


  m_ButtonBox.set_border_width(6);
  m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
  m_Button_Quit.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
  m_Button_Test.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_test) );
  show_all_children();
}

ExampleWindow::~ExampleWindow()
{
}



void ExampleWindow::on_page_close(int val)
{
  fprintf (stderr, "on_page_close!\n");
  Gtk::Container::remove (*PageVideo);
  delete PageVideo;
  PageVideo = NULL;
}

void ExampleWindow::on_button_test()
{
  fprintf (stderr, "button_test pressed\n");
  if (!PageVideo) {
    PageVideo = new class MPageVideo ();
    PageVideo->signal_something().connect (sigc::mem_fun (*this,
&ExampleWindow::on_page_close));
    PageVideo->show();
    m_align.add (*PageVideo);
    show_all_children();
    press_count++;
    fprintf (stderr, "MPageVideo created %d times\n", press_count);
  }
}

void ExampleWindow::on_button_quit()
{
  hide();
}


/* main.cc */
#include <gtkmm/main.h>
#include "examplewindow.h"

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

  ExampleWindow window;
  Gtk::Main::run(window); //Shows the window and returns when it is closed.

  return 0;
}

Steps to reproduce:
1. when app build done , run it.
2. use test button to create MPageVideo class.
3. when create MPageVideo done, click the rectangle to delete it.
4. repeat the prior operation about 100 times. 

Actual results:
the amount memory leak will be about 7M. use free to trace.


Expected results:
I expect there no memory leak.

Does this happen every time?
lost some memory

Other information:
The test platform of software is Fodero Core 4. 
The architecture I used is gtkmm/gtk+ for directfb/directfb/linux frame buffer.


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email



------------------------------

Message: 4
Date: Wed, 10 Jan 2007 08:42:13 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 394686] Started to wrap GdaQuery and
	its	dependencies
To: gtkmm-forge lists sourceforge net
Message-ID: <20070110084213 AE6CC6C40AC box gnome org>
Content-Type: text/plain; charset=utf-8

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=394686

  gnomemm | libgdamm | Ver: unspecified


Johannes Schmid changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #79856|none                        |committed
               Flag|                            |
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email



------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------

_______________________________________________
Gtkmm-forge mailing list
Gtkmm-forge lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/gtkmm-forge


End of Gtkmm-forge Digest, Vol 8, Issue 7
*****************************************



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