summaryrefslogtreecommitdiff
path: root/src/libcamera/base/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/base/object.cpp')
-rw-r--r--src/libcamera/base/object.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcamera/base/object.cpp b/src/libcamera/base/object.cpp
index ec5b55d1..92cecd22 100644
--- a/src/libcamera/base/object.cpp
+++ b/src/libcamera/base/object.cpp
@@ -189,7 +189,11 @@ void Object::message(Message *msg)
{
switch (msg->type()) {
case Message::InvokeMessage: {
- InvokeMessage *iMsg = static_cast<InvokeMessage *>(msg);
+ /*
+ * A static_cast should be enough, but gcc 10 and 11 choke on
+ * it in release mode (with -O2 or -O3).
+ */
+ InvokeMessage *iMsg = dynamic_cast<InvokeMessage *>(msg);
Semaphore *semaphore = iMsg->semaphore();
iMsg->invoke();