diff options
author | Chris Lerner <chris.lerner@qt.io> | 2024-04-05 15:32:56 +0200 |
---|---|---|
committer | Chris René Lerner <chris.lerner@qt.io> | 2024-04-05 14:55:21 +0000 |
commit | 09eeab6ef42d4f4ee66b19fa3e076d94b99837ad (patch) | |
tree | 05f2ab8f65c26923496242e9eddbb66584ee4c0d | |
parent | 50a3987427dd27e5bf697b46a3f022614bc3f15f (diff) |
Set up InAppPurchaseBackend for platforms other than Android and IOS
The hangman example relies on a backend for in-app purchases.
This backend was not properly set up for platforms other than IOS and
Android. This lead to an invalid memory access when utilizing the
backend which resulted in a crash.
Inside the function that does the backend setup, instead of immediately
returning on other platforms, assign an InAppPurchaseBackend object to
the backend variable. This will allow the application to keep running,
and warn the user that InAppPurchaseBackend is not implemented on
the platform.
Fixes: QTBUG-124146
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I77f64849bf16132f8380fd5b25db89098f86e2e5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
-rw-r--r-- | examples/demos/hangman/purchasing/inapp/inappstore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/demos/hangman/purchasing/inapp/inappstore.cpp b/examples/demos/hangman/purchasing/inapp/inappstore.cpp index 698ec0ea3..fd24dfe82 100644 --- a/examples/demos/hangman/purchasing/inapp/inappstore.cpp +++ b/examples/demos/hangman/purchasing/inapp/inappstore.cpp @@ -40,7 +40,7 @@ void InAppStore::setupBackend() #elif defined Q_OS_IOS d->backend = new IosInAppPurchaseBackend; #else - return; + d->backend = new InAppPurchaseBackend; #endif d->backend->setStore(this); |