diff --git a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp index 734de7a8c1..cc25f5ec51 100644 --- a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp +++ b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp @@ -94,7 +94,16 @@ struct InAppPurchases::Pimpl : public SKDelegateAndPaymentObserver /** AppStore implementation of hosted content download. */ struct DownloadImpl : public Download { - DownloadImpl (SKDownload* downloadToUse) : download (downloadToUse) {} + DownloadImpl (SKDownload* downloadToUse) + : download (downloadToUse) + { + [download retain]; + } + + ~DownloadImpl() + { + [download release]; + } String getProductId() const override { return nsStringToJuce (download.contentIdentifier); } String getContentVersion() const override { return nsStringToJuce (download.contentVersion); }