From fd0872d6308ebd0fc06e0512ebb4f04cf089e244 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Wed, 2 Sep 2020 15:08:17 -0500 Subject: [PATCH] UI: Fix memory leak when dropping files This fixes a memory leak when dropping files when the name is the same as other sources. --- UI/window-basic-main-dropfiles.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UI/window-basic-main-dropfiles.cpp b/UI/window-basic-main-dropfiles.cpp index 462161ba6..a10262ed2 100644 --- a/UI/window-basic-main-dropfiles.cpp +++ b/UI/window-basic-main-dropfiles.cpp @@ -51,8 +51,11 @@ static string GenerateSourceName(const char *base) } obs_source_t *source = obs_get_source_by_name(name.c_str()); + if (!source) return name; + else + obs_source_release(source); } }