- DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> > tmp{
- std::tuple<int32_t, int32_t, int32_t, int32_t>{rect.x, rect.y, rect.width, rect.height}};
-
- AddCoalescableMessage(CoalescableMessages::BOUNDS_CHANGED, obj, 1.0f, [=]() {
- mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> >, Address>(
- GetAccessiblePath(obj),
- Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
- "BoundsChanged",
- "",
- 0,
- 0,
- tmp,
- {"", "root"});
+ AddCoalescableMessage(CoalescableMessages::BOUNDS_CHANGED, obj.get(), 1.0f, [weakObj = std::weak_ptr<Accessible>(obj), rect = std::move(rect), this]() {
+ if(auto obj = weakObj.lock())
+ {
+ DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> > tmp{
+ std::tuple<int32_t, int32_t, int32_t, int32_t>{rect.x, rect.y, rect.width, rect.height}};
+
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> >, Address>(
+ GetAccessiblePath(obj.get()),
+ Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+ "BoundsChanged",
+ "",
+ 0,
+ 0,
+ tmp,
+ {"", "root"});
+ }