diff --git a/ext/or-tools/routing.cpp b/ext/or-tools/routing.cpp index ff61b0a..e1f5d4c 100644 --- a/ext/or-tools/routing.cpp +++ b/ext/or-tools/routing.cpp @@ -309,7 +309,7 @@ void init_routing(Rice::Module& m) { return Rice::detail::From_Ruby().convert(callback.call("call", from_index)); } ); - }) + }, Rice::Arg("callback").keepAlive()) .define_method("register_transit_matrix", &RoutingModel::RegisterTransitMatrix) .define_method( "register_transit_callback", @@ -319,7 +319,7 @@ void init_routing(Rice::Module& m) { return Rice::detail::From_Ruby().convert(callback.call("call", from_index, to_index)); } ); - }) + }, Rice::Arg("callback").keepAlive()) .define_method("add_dimension", &RoutingModel::AddDimension) .define_method("add_dimension_with_vehicle_transits", &RoutingModel::AddDimensionWithVehicleTransits) .define_method("add_dimension_with_vehicle_capacity", &RoutingModel::AddDimensionWithVehicleCapacity)