Hi,We have been using TurboActivate for quite a while now, but wanted to investigate using TurboFloat for some of our customers that would prefer floating licenses.
When I compile and run the Example.c file (on Mac) I'm getting an EXC_BAD_ACCESS (code=1, address=0x0)/Segmentation Fault 11 when calling TF_Cleanup. I reduced the Example.c code to the following which still gives me the same error in TF_Cleanup:
//================
#include <stdio.h>
/* Support Unicode compilation and non-Windows compilation */#ifdef _WIN32 #include <Windows.h> #include <tchar.h>#else #define _T(x) x typedef char TCHAR;#endif
#include "TurboFloat.h"
uint32_t tfHandle;
void TF_CC LeaseCallback(uint32_t status){ printf("LeaseCallback\n"); // This line of code doesn't get called when running this program}
int main(int argc, char* argv[]){ HRESULT hr; // These calls all seem to work fine tfHandle = TF_GetHandle(_T("xxxxxxxxxxxxxxxxxxxxxx.xxxxxxxx")); // Success: tfHandle != 0 hr = TF_SetLeaseCallback(tfHandle, LeaseCallback); // Success: hr == TF_OK hr = TF_SaveServer(tfHandle, _T("127.0.0.1"), 13, TF_USER); // Success: hr == TF_OK hr = TF_RequestLease(tfHandle); // Success: hr == TF_OK hr = TF_DropLease(tfHandle); // Success: hr == TF_OK // In here is where things seem to go wrong hr = TF_Cleanup(); // (Segmentation Fault: 11 when run in terminal) (EXC_BAD_ACCESS (code=1, address=0x0) when debugging in Xcode) return 0;}
//================
Am I missing something obvious? (hopefully) If anybody can spot a silly mistake I'm making, I'd appreciate it.
I'm using version 3.5.6 of the TurboFloat Server, and version 3.5.5.2 of the TurboFloat Library (the latest versions as of the time of this writing).
I compiled the code using both the LLVM 4.2 compiler in Xcode 4.6.1 on Mac OS X 10.8.5, and using the LLVM 5.1 compiler in Xcode 5.1 on Mac OS X 10.9.4, with the same results.
I've also tried running the TurboFloat Server for Mac on the same local computer (as shown in the code above) and also over a local network to a different computer running TurboFloat Server for Win. This also made no difference.
Thanks,Gareth