summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/embedded/qlock.cpp11
-rw-r--r--src/gui/embedded/qscreenlinuxfb_qws.cpp5
-rw-r--r--src/gui/embedded/qwslock.cpp16
-rw-r--r--src/gui/embedded/qwssignalhandler.cpp2
4 files changed, 29 insertions, 5 deletions
diff --git a/src/gui/embedded/qlock.cpp b/src/gui/embedded/qlock.cpp
index bb442e4..e7db7e6 100644
--- a/src/gui/embedded/qlock.cpp
+++ b/src/gui/embedded/qlock.cpp
@@ -173,7 +173,9 @@ QLock::QLock(const QString &filename, char id, bool create)
arg.val = MAX_LOCKS;
semctl(data->id,0,SETVAL,arg);
+#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->addSemaphore(data->id);
+#endif
}
#endif
if (data->id == -1) {
@@ -201,8 +203,15 @@ QLock::~QLock()
unlink(data->file);
}
#else
- if(data->owned)
+ if (data->owned) {
+#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->removeSemaphore(data->id);
+#else
+ qt_semun semval;
+ semval.val = 0;
+ semctl(data->id, 0, IPC_RMID, semval);
+#endif
+ }
#endif
delete data;
}
diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp
index 67c8a31..4b41b5b 100644
--- a/src/gui/embedded/qscreenlinuxfb_qws.cpp
+++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp
@@ -110,7 +110,9 @@ QLinuxFbScreenPrivate::QLinuxFbScreenPrivate()
#endif
ttyfd(-1), oldKdMode(KD_TEXT)
{
+#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->addObject(this);
+#endif
}
QLinuxFbScreenPrivate::~QLinuxFbScreenPrivate()
@@ -263,6 +265,9 @@ QLinuxFbScreen::QLinuxFbScreen(int display_id)
QLinuxFbScreen::~QLinuxFbScreen()
{
+#ifdef QT_NO_QWS_SIGNALHANDLER
+ delete d_ptr;
+#endif
}
/*!
diff --git a/src/gui/embedded/qwslock.cpp b/src/gui/embedded/qwslock.cpp
index a64dc3d..1d9bfb6 100644
--- a/src/gui/embedded/qwslock.cpp
+++ b/src/gui/embedded/qwslock.cpp
@@ -76,7 +76,9 @@ QWSLock::QWSLock()
perror("QWSLock::QWSLock");
qFatal("Unable to create semaphore");
}
+#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->addSemaphore(semId);
+#endif
qt_semun semval;
semval.val = 1;
@@ -103,15 +105,23 @@ QWSLock::QWSLock()
QWSLock::QWSLock(int id)
{
semId = id;
+#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->addSemaphore(semId);
+#endif
lockCount[0] = lockCount[1] = 0;
}
QWSLock::~QWSLock()
{
- if (semId == -1)
- return;
- QWSSignalHandler::instance()->removeSemaphore(semId);
+ if (semId != -1) {
+#ifndef QT_NO_QWS_SIGNALHANDLER
+ QWSSignalHandler::instance()->removeSemaphore(semId);
+#else
+ qt_semun semval;
+ semval.val = 0;
+ semctl(semId, 0, IPC_RMID, semval);
+#endif
+ }
}
static bool forceLock(int semId, unsigned short semNum, int)
diff --git a/src/gui/embedded/qwssignalhandler.cpp b/src/gui/embedded/qwssignalhandler.cpp
index 730dbae..2a20141 100644
--- a/src/gui/embedded/qwssignalhandler.cpp
+++ b/src/gui/embedded/qwssignalhandler.cpp
@@ -125,4 +125,4 @@ void QWSSignalHandler::handleSignal(int signum)
QT_END_NAMESPACE
-#endif // QT_QWS_NO_SIGNALHANDLER
+#endif // QT_NO_QWS_SIGNALHANDLER