| Summary: | Segmentation fault killing a bash session from another session | ||
|---|---|---|---|
| Product: | [Applications] yakuake | Reporter: | 81joe81 |
| Component: | general | Assignee: | Eike Hein <hein> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | jaak |
| Priority: | NOR | ||
| Version First Reported In: | 2.7.5 | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
81joe81
2006-03-23 13:50:53 UTC
Heads up: I've finally been able to reproduce this locally; I'm working on a fix for the next release. SVN commit 600111 by hein:
Fix crash when kpart in a tab other than
the currently selected tab goes down.
BUG:124129
M +4 -0 ChangeLog
M +9 -5 src/main_window.cpp
M +1 -1 src/main_window.h
M +3 -0 src/shell_session.cpp
M +6 -0 src/shell_session.h
--- trunk/extragear/utils/yakuake/ChangeLog #600110:600111
@@ -1,3 +1,7 @@
+Changes since 2.7.5
+- Fix crash when kpart in a tab other than the currently selected tab
+ is destroyed.
+
Changes since 2.7.4
- Further translations have been added.
- Yakuake no longer spawns login shells in new sessions.
--- trunk/extragear/utils/yakuake/src/main_window.cpp #600110:600111
@@ -487,7 +487,9 @@
sessions_stack.insert(index, session);
- connect(session, SIGNAL(destroyed()), this, SLOT(slotSessionDestroyed()));
+ session->setId(index);
+
+ connect(session, SIGNAL(destroyed(int)), this, SLOT(slotSessionDestroyed(int)));
connect(session, SIGNAL(titleUpdated()), this, SLOT(slotUpdateTitle()));
return index;
@@ -813,20 +815,22 @@
** Recreates the konsole kpart
********************************/
-void MainWindow::slotSessionDestroyed()
+void MainWindow::slotSessionDestroyed(int id)
{
if (isShuttingDown)
return;
- QWidget* widget = widgets_stack->widget(selected_id);
+ int session_id = (id != -1) ? id : selected_id;
+ QWidget* widget = widgets_stack->widget(session_id);
+
if (widget == 0L)
return;
widgets_stack->removeWidget(widget);
- sessions_stack.remove(selected_id);
+ sessions_stack.remove(session_id);
- if (tabs_bar->removeItem(selected_id) == -1)
+ if (tabs_bar->removeItem(session_id) == -1)
slotAddSession();
}
--- trunk/extragear/utils/yakuake/src/main_window.h #600110:600111
@@ -206,7 +206,7 @@
void slotIncreaseHeight();
void slotDecreaseHeight();
- void slotSessionDestroyed();
+ void slotSessionDestroyed(int id = -1);
void slotSetAccessKey();
void slotSetControlKeys();
--- trunk/extragear/utils/yakuake/src/shell_session.cpp #600110:600111
@@ -30,6 +30,7 @@
session_title = "";
session_widget = NULL;
session_terminal = NULL;
+ session_id = -1;
if ((factory = KLibLoader::self()->factory("libkonsolepart")) != NULL)
@@ -73,6 +74,8 @@
void ShellSession::slotDestroySession()
{
+ emit destroyed(session_id);
+
delete this;
}
--- trunk/extragear/utils/yakuake/src/shell_session.h #600110:600111
@@ -42,6 +42,9 @@
{
Q_OBJECT
+private:
+ int session_id;
+
public:
//-- PRIVATE ATTRIBUTES ---------------------------------------------//
@@ -67,6 +70,8 @@
//-- PUBLIC METHODS -------------------------------------------------//
+ void setId(int id) { session_id = id; }
+ int id() { return session_id; }
public slots:
@@ -83,6 +88,7 @@
//-- SIGNALS DEFINITION ---------------------------------------------//
void titleUpdated();
+ void destroyed(int id);
};
#endif /* SHELL_SESSION_H */
|