Cryptlex Forums

SetLicenseCallback to nullptr - yea or nay?

C
Carl Colijn

I’m making use of LexActivator’s SetLicenseCallback to get notified when a server sync has happened. However, I’m only interested in the very 1st server sync notification.

Is it OK if I call SetLicenseCallback(nullptr) at the end of my callback function to prevent any callbacks being done? Or might this lead to undefined behavior in the LexActivator library? So far it seems to work without crashing anything, but this isn’t documented either, so I’m a bit uneasy putting it in production code.

A
Adnan KamiliCryptlex team

Hi Carl,

I think setting this to null is fine unless you don’t do it in the callback itself.

Regards,
Adnan

C
Carl Colijn

Hi Adnan,

Thanks for that!
I’m setting it to nullptr at the end of the callback (just before returning from it), and indeed nothing seems to be crashing, also not when the time is right for the callback to be called again, so it seems to be handled OK.

← Back to all topics · 3 posts · 933 views · opened 2020-06-19