LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket 4.0 Programaticaly create / free memory leak ? (VB50 + Delphi6)

OS ver: W2000 pro (buld 2195) and WNT40
Software: VB50 pro, Delphi6 pro
DataSocket ver: V4.0 (370)

We're trying to dynamicaly create / destroy datasocket objects. The object is acually created and works OK. But when we try to free the object, the memory allocated for it remains the same ( checked with task manager ).
1. VB50:
// create one new object
Load CWDataSocket1(2)
// do something ...
// destroy and release memory
Unload CWDataSocket1(2)
this one works for some other activex and there's no memory leak !

2. VB50
Dim dynObject As Object

// create one new object
Set dynObject = CreateObject "CWDSLib.CWDataSocket")
// do something ...
//
destroy and release memory
Set dynObject = Nothing ' the application, then release the reference.

3. Delphi6
var dynDSocket1 : TCWDataSocket;

// create one new object
dynDSocket1 := TCWDataSocket.Create(Self);
// do something ...
// destroy and release memory
FreeAndNil(dynDSocket1);

Thank
0 Kudos
Message 1 of 3
(3,092 Views)
National Instruments doesn't support Delphi or Borland Builder with ComponentWorks any longer, however I did try reproducing the dynamic creation memory leak behavior you mentioned in VB, and successfully did so. After recreating the behavior I then checked our repository of known issues, and yes this has been reported before, even with the current release of DataSocket (4.0.375). I would look for this to be resolved in the next release of DataSocket, which has not yet been announced.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 3
(3,092 Views)
Hi,
I've seen a similar behavior using datasocket in CVI 6.0. I'm monitoring connections to be on, so when an error occur I call DS_DiscardObjHandle(myhandle), I wait for some seconds, and then I call DS_Open( ... , &myhandle). I receive no errors and everythings works, but for each cycle like this the application eats 4KB of memory per item.
Thanks for your attention and any suggestion.
Bye
0 Kudos
Message 3 of 3
(3,092 Views)