Patch #2239 2007-11-12 14:29

oswaldmi

(Sometimes) crash at startup
Download
2239-Sometimes_cras.patch (1.4 KB)
Category
Application::Bugfix
Status
Accepted
Close date
2007-11-12 14:54
Assigned to
 
Index: src/sdk/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp
===================================================================
--- src/sdk/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp        (revision 4623)
+++ src/sdk/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp        (working copy)
@@ -721,6 +721,7 @@
 , m_pDropTarget(NULL)
 , m_nLeftClickZone(wxFNB_NOWHERE)
 , m_customizeOptions(wxFNB_CUSTOM_ALL)
+, m_nFrom(0)
 {
        m_pRightClickMenu = NULL;
        m_nXButtonStatus = wxFNB_BTN_NONE;
@@ -1196,7 +1197,7 @@

                        wxRect tabRect = wxRect(pgInfo.GetPosition().x, pgInfo.GetPosition().y,
                                pgInfo.GetSize().x, pgInfo.GetSize().y);
-
+
                        if(InsideRect(tabRect, pt))
                        {
                                // We have a match
@@ -1301,7 +1302,7 @@
                //PopPageHistory(m_iActivePage);
        }

-       m_pagesInfoVec.RemoveAt(page);
+       m_pagesInfoVec.RemoveAt(page);

        if(m_iActivePage == wxNOT_FOUND && m_pagesInfoVec.Count() > 0){
                m_iActivePage = 0;
Index: src/sdk/logmanager.cpp
===================================================================
--- src/sdk/logmanager.cpp      (revision 4623)
+++ src/sdk/logmanager.cpp      (working copy)
@@ -9,7 +9,8 @@
 #include "loggers.h"

 LogSlot::LogSlot()
-       : log(0)
+       : log(0),
+       icon(0)
 {
 }
oswaldmi 2007-11-12 14:34

Code::Blocks crashed at startup because of uninitialized values.

The long story: after updating from the svn, code::blocks didn't start anymore and crashed. I wrote a bug report and switched to KDevelop because I have no time. Guess what. KDevelop started to crash too.

So I let valgrind check it and it put up three jumps based on uninitialized values (see the bugs posting). After some search I found the uninitialized values and initialized them in the constructors with some default values. Hope they are ok.

Nevertheless, Code::Blocks keeps crashing after some seconds after loading my project but only the first time it is started. Neither gdb nor valgrind have come up with something (when they are activated, it actually doesn't crash), so I don't know why or where and unfortunately I don't have time for further research.

mandrav 2007-11-12 14:54

Thank you.