author | mickeyl <mickeyl> | 2003-03-02 22:53:10 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-02 22:53:10 (UTC) |
commit | affe85499e4650076bcd6058c18ba44d9a6117be (patch) (side-by-side diff) | |
tree | b787f542e183b58d9f2b75f376f3c3bc5d5fa3d3 | |
parent | ab5f21907fb482d35f8aebe4505e954d3c22f3c7 (diff) | |
download | opie-affe85499e4650076bcd6058c18ba44d9a6117be.zip opie-affe85499e4650076bcd6058c18ba44d9a6117be.tar.gz opie-affe85499e4650076bcd6058c18ba44d9a6117be.tar.bz2 |
fix "segfault-on-close" bug
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index dd8a365..09a44e6 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -108,3 +108,3 @@ Wellenreiter::Wellenreiter( QWidget* parent ) fcntl( daemon_fd, F_SETFL, flags | O_NONBLOCK ); - QSocketNotifier *sn = new QSocketNotifier( daemon_fd, QSocketNotifier::Read, parent ); + QSocketNotifier *sn = new QSocketNotifier( daemon_fd, QSocketNotifier::Read, this ); connect( sn, SIGNAL( activated( int ) ), this, SLOT( dataReceived() ) ); @@ -126,7 +126,2 @@ Wellenreiter::~Wellenreiter() - // X11-only - Hmm... Closing the socket here segfaults on exit, - // Maybe because the notifier still has a handle to it!? Seems not to - // occur on Qt/Embedded - - #ifdef QWS if ( daemon_fd != -1 ) @@ -134,6 +129,6 @@ Wellenreiter::~Wellenreiter() qDebug( "closing comm socket" ); - close( daemon_fd ); + ::shutdown( daemon_fd, 0 ); + ::close( daemon_fd ); + qDebug( "comm socket closed." ); } - #endif - } |