diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2024-03-11 18:52:17 +0300 |
---|---|---|
committer | Alexander Golubev <fatzer2@gmail.com> | 2024-03-16 02:45:44 +0300 |
commit | ba2deea50adde9d33b65a4d1012f8402bf44b590 (patch) | |
tree | 5d400567bcd69f6150890f936981da998cbd3350 | |
parent | 3eb9061b6344a1de8973fc14085618b0c46909ae (diff) | |
download | tqt3-ba2deea50adde9d33b65a4d1012f8402bf44b590.tar.gz tqt3-ba2deea50adde9d33b65a4d1012f8402bf44b590.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.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp index 44971cfe6..5c78c17bc 100644 --- a/src/kernel/qobject.cpp +++ b/src/kernel/qobject.cpp @@ -1094,10 +1094,10 @@ bool TQObject::event( TQEvent *e ) TQSenderObjectList* sol; TQObject* oldSender = 0; sol = 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 = metaEvent->sender(); @@ -1112,10 +1112,10 @@ bool TQObject::event( TQEvent *e ) if (metaEvent->type() == TQMetaCallEvent::MetaCallInvoke) { tqt_invoke( metaEvent->id(), o ); } + if (sol ) { #ifdef TQT_THREAD_SUPPORT - sol->listMutex->lock(); + sol->listMutex->lock(); #endif // TQT_THREAD_SUPPORT - if (sol ) { sol->currentSender = oldSender; if ( sol->deref() ) { #ifdef TQT_THREAD_SUPPORT @@ -2794,10 +2794,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; @@ -2809,9 +2809,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()) { @@ -2832,9 +2832,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()) { |