Re: One crash issue



On Sat, 2010-03-20 at 22:12 +0800, Zhu Bicen wrote:
> Below code can be compiled and launched successfully, but after exit
> it(by hitting the close button ) it crash.
> VC++ 2005 express give me following info:
> 
> "Windows has triggered a breakpoint in LogLeader.exe.
> This may be due to a corruption of the heap, and indicates a bug in
> LogLeader.exe or any of the DLLs it has loaded.
> The output window may have more diagnostic information"
> 
> How to fix this? Any comments or advice is appreciated!
> Thanks!

Is this Debug or Release? Does the Release build work? If so, please
check that the "Runtime Library" in the "Code generation" section of the
project property is set to "Multi-threaded Debug DLL". The default seems
to be incorrect for new, empty projects in MSVC 2005.

> class LogListView : public Gtk::ScrolledWindow
> {
> public:
>     LogListView();
>     virtual ~LogListView(){}
> private:
>     Gtk::TreeView m_TreeView;
>     Glib::RefPtr<Gtk::ListStore> m_refListStore;
>     struct ModelColumns : public Gtk::TreeModel::ColumnRecord
>     {
>         Gtk::TreeModelColumn<Glib::ustring> group;
>         Gtk::TreeModelColumn<Glib::ustring> code;
>         Gtk::TreeModelColumn<Glib::ustring> timeStamp;
> 
>         ModelColumns() { add(group); add(code); add(timeStamp); }
>     };
>     ModelColumns m_columns;    
> };
> LogListView::LogListView()
> {
>     //create module
>     m_refListStore= Gtk::ListStore::create(m_columns);
>     //create treeView
>     m_TreeView.set_model(m_refListStore);
>     m_TreeView.set_rules_hint();
>     m_TreeView.append_column("Group", m_columns.group );
>     m_TreeView.append_column("Code", m_columns.code);
>     m_TreeView.append_column("TimeStamp", m_columns.timeStamp);
>     add( m_TreeView );   
>     show_all();
> }
> class MainWindow : public Gtk::Window
> {
> public:
>     MainWindow()
>     {
>         set_title("LoggerLeader");
>         add( logListView_ );
>         set_default_size(600, 500);
>         show_all();
>     }
>     void on_button_quit()
>     {
>         hide();
>     }
> 
>     ~MainWindow(){}
> private:
> 
>     LogListView logListView_;
> };
> int main(int argc, char *argv[])
> {
>     Gtk::Main kit(argc, argv);
>     MainWindow window;
>     Gtk::Main::run(window);
>     return 0;
> }

Armin



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