diff options
| author | Brian Potchik <brian@vector35.com> | 2018-08-10 13:56:34 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2018-08-10 13:56:34 -0400 |
| commit | 6ef32157e767aacd142012206bcf79c48266da2a (patch) | |
| tree | 49963df2faa2c38201ac8d7694a366bc3080c389 /downloadprovider.cpp | |
| parent | 06a10105c9dd2512859597b848251f9c32037125 (diff) | |
Fix DownloadProvider reference counting and instance cleanup.
Diffstat (limited to 'downloadprovider.cpp')
| -rw-r--r-- | downloadprovider.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/downloadprovider.cpp b/downloadprovider.cpp index 0e3483df..436e2516 100644 --- a/downloadprovider.cpp +++ b/downloadprovider.cpp @@ -10,6 +10,7 @@ DownloadInstance::DownloadInstance(DownloadProvider* provider) cb.context = this; cb.destroyInstance = DestroyInstanceCallback; cb.performRequest = PerformRequestCallback; + AddRefForRegistration(); m_object = BNInitDownloadInstance(provider->GetObject(), &cb); } @@ -20,6 +21,12 @@ DownloadInstance::DownloadInstance(BNDownloadInstance* instance) } +DownloadInstance::~DownloadInstance() +{ + BNFreeDownloadInstance(m_object); +} + + void DownloadInstance::DestroyInstanceCallback(void* ctxt) { DownloadInstance* instance = (DownloadInstance*)ctxt; |
