From b160aa0bac77a45bd7c4f39c6fe0263059239d4b Mon Sep 17 00:00:00 2001 From: Xusheng Date: Thu, 20 Oct 2022 11:17:20 +0800 Subject: Properly remove the debugger view from the FileMetadata after the target exits. Fix https://github.com/Vector35/debugger/issues/279 --- binaryninjaapi.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index d8163343..1dcdc48a 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1845,6 +1845,22 @@ namespace BinaryNinja { \return Current Session ID */ size_t GetSessionId() const; + + /*! Explicitly unregister a binary view of the given type from this file. + + \note There is no need to unregister a binary view in ordinary situations. Binary views will be + automatically unregistered from the file when the file itself is about to be freed. Also, when a + binary view with the same type is created, the old one is automatically unregistered from the file. + + Only use this function when you wish to explicitly remove the binary view from the file. For example, + in the debugger, this method is used to remove the Debugger view from the file after the target exits. + + This also does not necessarily free the binary, because there could be other references to it. + + \param type the type of the view to unregister + \param data the binary view to unregister + */ + void UnregisterViewOfType(const std::string& type, BinaryNinja::Ref data); }; class Function; -- cgit v1.3.1