From 2e0798746c41ab518a69906e2189a3993c84fae9 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Thu, 9 Feb 2017 17:35:36 +0100 Subject: [PATCH] Also deinit libgit2 in TortoiseGit.dll Signed-off-by: Sven Strickroth --- src/TortoiseShell/ShellExtClassFactory.cpp | 3 +++ src/TortoiseShell/TortoiseGIT.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TortoiseShell/ShellExtClassFactory.cpp b/src/TortoiseShell/ShellExtClassFactory.cpp index 3edd387b5..0999795ba 100644 --- a/src/TortoiseShell/ShellExtClassFactory.cpp +++ b/src/TortoiseShell/ShellExtClassFactory.cpp @@ -55,6 +55,7 @@ STDMETHODIMP CShellExtClassFactory::QueryInterface(REFIID riid, STDMETHODIMP_(ULONG) CShellExtClassFactory::AddRef() { + git_libgit2_init(); return InterlockedIncrement(&m_cRef); } @@ -65,6 +66,8 @@ STDMETHODIMP_(ULONG) CShellExtClassFactory::Release() delete this; + git_libgit2_shutdown(); + return 0L; } diff --git a/src/TortoiseShell/TortoiseGIT.cpp b/src/TortoiseShell/TortoiseGIT.cpp index 35fb372f8..3bd76a84b 100644 --- a/src/TortoiseShell/TortoiseGIT.cpp +++ b/src/TortoiseShell/TortoiseGIT.cpp @@ -149,7 +149,6 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvOut) if (!pcf) return E_OUTOFMEMORY; // refcount currently set to 0 - git_libgit2_init(); const HRESULT hr = pcf->QueryInterface(riid, ppvOut); if(FAILED(hr)) delete pcf; -- 2.11.4.GIT