BT_MOVE(): call bt_put(_dst)
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 1 Feb 2016 13:21:00 +0000 (08:21 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 19 Feb 2016 20:15:48 +0000 (15:15 -0500)
commitf62d1f558a69c03abae7ae054e135e4478655bf9
tree530095d80114e2aae4a6449d5ce195de744a43fe
parentd480b699c96186b69cb91eac28e8f3128fdec7bb
BT_MOVE(): call bt_put(_dst)

It makes no semantical sense to move a reference from a variable
to another without first putting the destination, if it has one.
Otherwise this would be a lost reference, unless it was moved
elsewhere or put manually using bt_put() previously, which is why
BT_MOVE() should always be used for move semantics and BT_PUT() is
preferred to bt_put() to avoid this situation.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/ref.h
tests/lib/test_bt_values.c
This page took 0.024728 seconds and 4 git commands to generate.