Open GaRaOne opened 5 years ago
Hmm... Someone added thread safety recently for Qt versions > 5.10 maybe it's a result of those changes? I can't dig out the commit right now - but it's fairly recent. Maybe that's the culprit?
@GaRaOne - this PR https://github.com/Larpon/QtFirebase/pull/82
It seems to be a fundamental problem of the Admob implementation in QtFirebase. The use of callbacks across threads and the storage of payload in the objects, which can be destroyed at any time by QML.
I try to read in the code the next few days. When I get to that, I completely change the code to the polling mechanisms of firebase_cpp.
greets from germany
There is a first iteration of the refactoring: https://github.com/GaRaOne/QtFirebase/blob/admob-refactoring/src/qtfirebaseadmob.h https://github.com/GaRaOne/QtFirebase/blob/admob-refactoring/src/qtfirebaseadmob.cpp
We still testing the branch, so it is not bug free. We also currently have no chance to test it on iOS in the wild.
Take a look at the changes and tell me how we go on from here?
@GaRaOne - thanks for your efforts! I'll take a look as soon as possible. I'm drowning in work ATM
... on a quick side note: I don't think I'll do the merges manually no matter what. I haven't looked at you code yet - but I know we moved away from polling via the event-loop some time ago - which makes it unlikely that we would bring it back. Also so far you're the only one to report so severe crashes. Could it be you're using it in exotic ways?
When I first wrote the AdMob module it was made to support primarily QML - so it's use was designed to follow the QML engine's garbage collection. I haven't had any crashes recently in any of my live apps using it - that's why I'm questioning the crashes :slightly_smiling_face:
When I first wrote the AdMob module it was made to support primarily QML - so it's use was designed to follow the QML engine's garbage collection. I haven't had any crashes recently in any of my live apps using it - that's why I'm questioning the crashes
The Qml flow is the cause for the crashes. firebase_cpp assume static c strings in all its examples. Qml/QtFirebase use dynamic allocated strings. you tried to solve this by caching the strings in the Request-Object. But at the point an AdmobBanner, AdmobInterstitial or AdmobRewardedAd gets destructed, all the this strings/pointer get undefined. Same if you change a Request Property.
Also there is a flaw with the callbacks. If a callback is processed after the destruction of an AdmobXxx instance, the whole app crashes. I try to do no logic in the Listener-Callbacks (OnBoundingBoxChanged is the only left) to address this Problem.
We have a trigger in the App which activates/deactivates all Advertising by QmlLoaders, if the user purchase an InApp-Item ... with the master branch it crashes in QtFirebase/firebase_cpp nearly every time.
Just look at it and give it a try :) ...
We have serveral crash reports on android in our last release... mostly while loading of banner and rewared ads... interstitials seems to be stable instead.
do you have any idea?
we shipped with:
QtFirebaseAdMobBanner::loadInternal
QtFirebaseAdMobRewardedVideoAd::loadInternal