News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Free Memory from CCyBulkEndPoint *BulkOutEP

Started by nukers, January 15, 2014, 03:25:29 PM

Previous topic - Next topic

nukers

Hallo all,

I use TE-0320 and TE USB Suite to communicate with my Board.
I've created new Project with code example from https://wiki.trenz-electronic.de/pages/viewpage.action?pageId=10620603 at the page below.

The Problem: I can't delete follow pointer CCyBulkEndPoint *BulkOutEP with delete BulkOutEP operation.
I use Visual Studio 2010 and C++ Project.
Has anybody the answer for me?

Thnx
Alex

Horsa

#1
Hello Alex,
please help us to solve your issue.

1) Does your code is memory managed or not?
2) Can you please tell us the exact error message issued by Visual Studio?
3) can you please send your project to support? (or at least the file(s) that use(s) the TE C++ library causing the problem)
5) Do you destroy the pointer before deleting it?
6) You may try the following code instead:
((CCyBulkEndPoint *)BulkOutEP )->~CCyBulkEndPoint();

nukers

#2
Hallo Horsa,

Thak you for your answer.
But I've found my error yet :)

The error was:
First have I created CCyBulkEndPoint *BulkOutEP = NULL in one my function and after using it I tried to delete it with delete BulkOutEP;, but it is not needed, because C++ makes it automatically, as it goes out from the function.

The Operation ((CCyBulkEndPoint *)BulkOutEP )->~CCyBulkEndPoint(); does not work too for me.


You can try to reach this error, if you use your project TE_USB_FX2_CyAPI_SampleApplication-32-VSExpress+VSProfessional.zip  from http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE-USB-Suite/d2/generation_3/d3/reference_designs/d4/TE_USB_FX2.Cpp.html and delete the pointer of  CCyBulkEndPoint in the ReadData_troughput() function after deleteing variable data. It comes to error too.

Thnx
Alex