Skip to content

Commit

Permalink
Don't use pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
uerceg committed Jun 16, 2020
1 parent a330611 commit 297e92b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Binary file modified ext/android/proxy/adjust-android.jar
Binary file not shown.
Binary file modified ext/android/proxy/adjust-test.jar
Binary file not shown.
Binary file modified libs/android/adjust-android.jar
Binary file not shown.
Binary file modified libs/ios/AdjustSdk.framework/Versions/A/AdjustSdk
Binary file not shown.
22 changes: 11 additions & 11 deletions test/app/Classes/AdjustCommandExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,21 +591,21 @@ void AdjustCommandExecutor::trackSubscription() {
std::string transactionDate = command->getFirstParameterValue("transactionDate");
std::string salesRegion = command->getFirstParameterValue("salesRegion");

AdjustAppStoreSubscription2dx *subscription = new AdjustAppStoreSubscription2dx(
AdjustAppStoreSubscription2dx subscription = AdjustAppStoreSubscription2dx(
price,
currency,
transactionId,
receipt
);
subscription->setTransactionDate(transactionDate);
subscription->setSalesRegion(salesRegion);
subscription.setTransactionDate(transactionDate);
subscription.setSalesRegion(salesRegion);

if (this->command->containsParameter("callbackParams")) {
std::vector<std::string> callbackParams = command->getParameters("callbackParams");
for (int i = 0; i < callbackParams.size(); i = i + 2) {
std::string key = callbackParams[i];
std::string value = callbackParams[i + 1];
subscription->addCallbackParameter(key, value);
subscription.addCallbackParameter(key, value);
}
}

Expand All @@ -614,11 +614,11 @@ void AdjustCommandExecutor::trackSubscription() {
for (int i = 0; i < partnerParams.size(); i = i + 2) {
std::string key = partnerParams[i];
std::string value = partnerParams[i + 1];
subscription->addPartnerParameter(key, value);
subscription.addPartnerParameter(key, value);
}
}

Adjust2dx::trackAppStoreSubscription(*subscription);
Adjust2dx::trackAppStoreSubscription(subscription);
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
std::string price = command->getFirstParameterValue("revenue");
std::string currency = command->getFirstParameterValue("currency");
Expand All @@ -628,22 +628,22 @@ void AdjustCommandExecutor::trackSubscription() {
std::string purchaseToken = command->getFirstParameterValue("purchaseToken");
std::string purchaseTime = command->getFirstParameterValue("transactionDate");

AdjustPlayStoreSubscription2dx *subscription = new AdjustPlayStoreSubscription2dx(
AdjustPlayStoreSubscription2dx subscription = AdjustPlayStoreSubscription2dx(
price,
currency,
sku,
orderId,
signature,
purchaseToken
);
subscription->setPurchaseTime(purchaseTime);
subscription.setPurchaseTime(purchaseTime);

if (this->command->containsParameter("callbackParams")) {
std::vector<std::string> callbackParams = command->getParameters("callbackParams");
for (int i = 0; i < callbackParams.size(); i = i + 2) {
std::string key = callbackParams[i];
std::string value = callbackParams[i + 1];
subscription->addCallbackParameter(key, value);
subscription.addCallbackParameter(key, value);
}
}

Expand All @@ -652,10 +652,10 @@ void AdjustCommandExecutor::trackSubscription() {
for (int i = 0; i < partnerParams.size(); i = i + 2) {
std::string key = partnerParams[i];
std::string value = partnerParams[i + 1];
subscription->addPartnerParameter(key, value);
subscription.addPartnerParameter(key, value);
}
}

Adjust2dx::trackPlayStoreSubscription(*subscription);
Adjust2dx::trackPlayStoreSubscription(subscription);
#endif
}
Binary file modified test/libs/android/adjust-test.jar
Binary file not shown.
Binary file not shown.

0 comments on commit 297e92b

Please sign in to comment.