summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/binaryview.rs2
-rw-r--r--rust/src/flowgraph.rs6
2 files changed, 3 insertions, 5 deletions
diff --git a/rust/src/binaryview.rs b/rust/src/binaryview.rs
index 33fd9881..6e510694 100644
--- a/rust/src/binaryview.rs
+++ b/rust/src/binaryview.rs
@@ -1064,7 +1064,7 @@ pub trait BinaryViewExt: BinaryViewBase {
unsafe { BNApplyDebugInfo(self.as_ref().handle, debug_info.handle) }
}
- fn show_graph_report<S: BnStrCompatible>(&self, raw_name: S, graph: FlowGraph) {
+ fn show_graph_report<S: BnStrCompatible>(&self, raw_name: S, graph: &FlowGraph) {
let raw_name = raw_name.into_bytes_with_nul();
unsafe {
BNShowGraphReport(
diff --git a/rust/src/flowgraph.rs b/rust/src/flowgraph.rs
index 9d95cc49..c2d4d559 100644
--- a/rust/src/flowgraph.rs
+++ b/rust/src/flowgraph.rs
@@ -114,8 +114,6 @@ impl<'a> ToOwned for FlowGraphNode<'a> {
}
}
-// TODO : FlowGraph are RefCounted objects, this needs to be changed to only return Refs to FlowGraph
-
#[derive(PartialEq, Eq, Hash)]
pub struct FlowGraph {
pub(crate) handle: *mut BNFlowGraph,
@@ -126,8 +124,8 @@ impl FlowGraph {
Self { handle: raw }
}
- pub fn new() -> Self {
- unsafe { FlowGraph::from_raw(BNCreateFlowGraph()) }
+ pub fn new() -> Ref<Self> {
+ unsafe { Ref::new(FlowGraph::from_raw(BNCreateFlowGraph())) }
}
pub fn append(&self, node: &FlowGraphNode) -> usize {