Hi,

after this bug annoyed me so much, I spend some time on it, and it comes out, 
that it really wasn't that complicated.

Attached you find a patch, which solves the problem.


Thanks,
Johannes

On Thursday 24 September 2009 10:40:59 Johannes Zellner wrote:
> Hi,
> 
> since about a week, I encounter many crashes in rekonq after
> closing/opening/loadnewpage/...
> 
> It's at least on my box easy to reproduce.
> - Open two separate rekonq windows and close one of them.
> - Now try to open a new tab on the lasting window --> crash.
> 
> Attached are two backtraces:
> rekonq-20090924.kcrash:       crash after opening new tab
> rekonq-20090924-2.kcrash:     crash after loading different page in existing
>  tab
> 
> For now I was not able to find the problem...I'm not aware of the flow
>  within rekonq with separate windows.
> 
> It looks like it tries to access tabs in the closed window, which are not
> existing anymore.
> 
> Thanks,
> Johannes
> 
diff --git a/src/application.cpp b/src/application.cpp
index 683a405..9bbf779 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -406,6 +406,12 @@ MainWindow *Application::newMainWindow()
 }
 
 
+void Application::removeMainWindow(MainWindow *window)
+{
+    m_mainWindows.removeAt(m_mainWindows.indexOf(window, 0));
+}
+
+
 MainWindowList Application::mainWindowList()
 {
     return m_mainWindows;
diff --git a/src/application.h b/src/application.h
index 61d93b8..e5616d5 100644
--- a/src/application.h
+++ b/src/application.h
@@ -127,6 +127,8 @@ public slots:
                   const Rekonq::OpenType& type = Rekonq::CurrentTab
                 );    
 
+    void removeMainWindow(MainWindow *window);
+
 private slots:
 
     /**
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 345cfda..722189f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -143,6 +143,7 @@ MainWindow::MainWindow()
 
 MainWindow::~MainWindow()
 {
+    Application::instance()->removeMainWindow(this);
     delete m_popup;
     delete m_view;
 }
_______________________________________________
rekonq mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/rekonq

Reply via email to