01-10-2012 03:41 PM
I just read the "Selling Digital Goods" recipe on the Blackberry Native SDK documentation website. I have one question. The code allocates memory for a purchase_params_t by calling malloc(). But there is no free() call anywhere in the sample code. Is the memory freed automatically by paymentservice_purchase()? Or is it the responsibility of the programmer to call free() (and the sample code just doesn't show it) ? Must purchase_params_t be allocated on the heap? Or can it go on the stack?
Thanks in advance!
01-10-2012 04:05 PM - edited 01-10-2012 04:07 PM
One more thing... the API reference shows the paymentservice_purchase() function as:
int paymentservice_purchase(purchase_params_t params, const char *group_id)
It looks like it takes a copy of a purchase_params_t object. But the sample code shows it as taking a pointer... I'm confused...
"Selling Digital Goods" Recipe link: https://bdsc.webapps.blackberry.com/native/documen
paymentservice_purchase() API Reference link: https://bdsc.webapps.blackberry.com/native/referen
01-10-2012 04:49 PM
@Blackberry/RIM, can you please update the sample code in the aforementioned recipe? It is showing incorrect usage of the payment API.
Thanks in advance.
01-11-2012 09:20 AM
Feel free to log this and any other found issues directly into our external bug tracking/feature request system:
This will let you track the progress of the fix.
01-11-2012 10:40 AM
Thanks for your reply. I've logged this into the Issue Tracker. If anyone wants to track its progress, you can find the issue here: