summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2024-03-11 18:52:17 +0300
committerAlexander Golubev <fatzer2@gmail.com>2024-03-13 20:47:55 +0300
commit14e882386b4fd47c22304156f0bfc2a0c599b617 (patch)
treeb4f5dbca5cf2e76840177872f1d14602b44e1536
parentebc3e67bf427f4210264c2259ea2887bca745fee (diff)
downloadtqt3-14e882386b4fd47c22304156f0bfc2a0c599b617.tar.gz
tqt3-14e882386b4fd47c22304156f0bfc2a0c599b617.zip
TQObject::activate_signal: uniformly apply if(sol) checks
It seems the situation where sol is NULL is theoretically possible. So keep the checks and apply those uniformly to all instances of access to `sol`. Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
-rw-r--r--src/kernel/qobject.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp
index 6b28b15ff..b8f1a6ee8 100644
--- a/src/kernel/qobject.cpp
+++ b/src/kernel/qobject.cpp
@@ -2809,10 +2809,10 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
TQObject *object = c->object();
TQObject *oldSender;
TQSenderObjectList* sol = object->senderObjects;
+ if ( sol ) {
#ifdef TQT_THREAD_SUPPORT
- sol->listMutex->lock();
+ sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
- if ( sol ) {
oldSender = sol->currentSender;
sol->ref();
sol->currentSender = this;
@@ -2824,9 +2824,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
(currentThread && currentThread->threadPostedEventsDisabled()) ||
(currentThread && object->d->ownThread == currentThread)
) {
- sol->listMutex->unlock();
+ if (sol) sol->listMutex->unlock();
object->tqt_emit( c->member(), o );
- sol->listMutex->lock();
+ if (sol) sol->listMutex->lock();
}
else {
if (object->d->ownThread && !object->d->ownThread->finished()) {
@@ -2847,9 +2847,9 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
(currentThread && currentThread->threadPostedEventsDisabled()) ||
(currentThread && object->d->ownThread == currentThread)
) {
- sol->listMutex->unlock();
+ if (sol) sol->listMutex->unlock();
object->tqt_invoke( c->member(), o );
- sol->listMutex->lock();
+ if (sol) sol->listMutex->lock();
}
else {
if (object->d->ownThread && !object->d->ownThread->finished()) {