mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fix options getting deallocated early in C++ header
This commit is contained in:
@@ -347,15 +347,17 @@ public:
|
|||||||
* @param locator Override the default locator configuration (usually used for testing / mocks).
|
* @param locator Override the default locator configuration (usually used for testing / mocks).
|
||||||
*/
|
*/
|
||||||
UpdateManager(const std::string& urlOrPath, const UpdateOptions* options = nullptr, const VelopackLocatorConfig* locator = nullptr) {
|
UpdateManager(const std::string& urlOrPath, const UpdateOptions* options = nullptr, const VelopackLocatorConfig* locator = nullptr) {
|
||||||
|
vpkc_update_options_t vpkc_options;
|
||||||
vpkc_update_options_t* pOptions = nullptr;
|
vpkc_update_options_t* pOptions = nullptr;
|
||||||
if (options != nullptr) {
|
if (options != nullptr) {
|
||||||
vpkc_update_options_t vpkc_options = to_c(*options);
|
vpkc_options = to_c(*options);
|
||||||
pOptions = &vpkc_options;
|
pOptions = &vpkc_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vpkc_locator_config_t vpkc_locator;
|
||||||
vpkc_locator_config_t* pLocator = nullptr;
|
vpkc_locator_config_t* pLocator = nullptr;
|
||||||
if (locator != nullptr) {
|
if (locator != nullptr) {
|
||||||
vpkc_locator_config_t vpkc_locator = to_c(*locator);
|
vpkc_locator = to_c(*locator);
|
||||||
pLocator = &vpkc_locator;
|
pLocator = &vpkc_locator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user