Skip to content

Commit b74b21d

Browse files
committed
[SharedCache] Remove some dead code and misc lints
1 parent 051ca95 commit b74b21d

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

view/sharedcache/core/SharedCache.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ SharedCache::SharedCache(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView) :
14491449
return;
14501450
}
14511451

1452-
sharedCacheReferences++;
1452+
++sharedCacheReferences;
14531453
INIT_SHAREDCACHE_API_OBJECT()
14541454
if (!DeserializeFromRawView(lock))
14551455
{
@@ -1494,7 +1494,7 @@ SharedCache::SharedCache(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView) :
14941494
}
14951495

14961496
SharedCache::~SharedCache() {
1497-
sharedCacheReferences--;
1497+
--sharedCacheReferences;
14981498
}
14991499

15001500
SharedCache* SharedCache::GetFromDSCView(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView)
@@ -3636,19 +3636,12 @@ std::string SharedCacheMetadata::InstallNameForImageBaseAddress(uint64_t baseAdd
36363636

36373637
} // namespace SharedCacheCore
36383638

3639-
namespace {
3640-
3641-
[[maybe_unused]] DSCViewType* g_dscViewType;
3642-
3643-
}
3644-
36453639
void InitDSCViewType() {
36463640
MMappedFileAccessor::InitialVMSetup();
36473641
std::atexit(VMShutdown);
36483642

36493643
static DSCViewType type;
36503644
BinaryViewType::Register(&type);
3651-
g_dscViewType = &type;
36523645
}
36533646

36543647
extern "C"
@@ -3688,7 +3681,7 @@ extern "C"
36883681
bool BNDSCViewLoadImageWithInstallName(BNSharedCache* cache, char* name, bool skipObjC)
36893682
{
36903683
std::string imageName = std::string(name);
3691-
// FIXME !!!!!!!! BNFreeString(name);
3684+
BNFreeString(name);
36923685

36933686
if (cache->object)
36943687
return cache->object->LoadImageWithInstallName(imageName, skipObjC);

view/sharedcache/ui/SharedCacheUINotifications.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q
4848
if (!ah->isBoundAction("Load Image by Name"))
4949
{
5050
ah->bindAction("Load Image by Name", UIAction([view = view](const UIActionContext& ctx) {
51-
Ref<SharedCacheAPI::SharedCache> cache = new SharedCacheAPI::SharedCache(view);
5251
DisplayDSCPicker(ctx.context, view);
5352
}));
5453
ah->bindAction("Load Section by Address", UIAction([view = view](const UIActionContext& ctx) {

0 commit comments

Comments
 (0)