Variant::as<>() should not consume the variant.

Bug #1339602 reported by Antti Kaijanmäki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dbus-cpp
New
Undecided
Unassigned

Bug Description

I'm seeing the following errors:

void core::dbus::Property<T>::handle_changed(const core::dbus::types::Variant&) [with PropertyType = test::Service::Properties::ReadOnly]: Mismatch between expected and actual type reported by iterator:
         Expected: uint32
         Actual: invalid
void core::dbus::Property<T>::handle_changed(const core::dbus::types::Variant&) [with PropertyType = test::Service::Properties::ReadOnly]: Mismatch between expected and actual type reported by iterator:
         Expected: uint32
         Actual: invalid

This seems like Variant is consumed by the first caller of Variant::as<>(). This will be a problem for example if there are multiple handlers of a signal that passes an Variant as an argument.

There should not be a limit how many times Variant::as<>() or any other conversion function can be called.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.