LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory leak using imaqDispose

Hi !

 

Thanks to everyone who spend some time  on my problem

 

I don't understand why, but the imaqDispose function create memory leaks.

For exemple,  when I try :

 

    StraightEdgeReport2* straightEdgeReport = NULL;

    .....  

     while( i<6000 )
     {
             straightEdgeReport = imaqStraightEdge(image, roi, IMAQ_SEARCH_DIRECTION_LEFT_TO_RIGHT, edgeOptions, straightEdgeOptions);    
             imaqDispose(straightEdgeReport);   

             i++;

     }    

     ......

 

After a while, I've got an error message that said I haven't enough memory to create a straigthEdgeReport. I tried to use the free() fonction, but I got the same error.

I work with LabWindows 8.5.0.

 

Thanks, A+.

 

0 Kudos
Message 1 of 4
(3,625 Views)

Hi Sadalsud17,

This was reported to R&D (#128911) for further investigation.  Thanks for the feedback!

Best regards

Yann C.

France

0 Kudos
Message 2 of 4
(3,598 Views)

Thanks...

 

I reopened this topic because of some changes.

Untill the bug is fixed, I simply avoid to use imaqStraightEdges in loops. I have some memory leak (4Ko each time) but it still working.

 

However I recently installed the update Vision 8.6.4 (I did it because I had memory leaks with imaqLearnPattern3).

Now, each time I call imaqStraightEdges I have almost 100 Mo of memory leak, so my programm crash eventually.

 

I need both imaqStraightEdges and imaqLearnPattern in my project...Does anyone know how I can fix this problem or when R&D will release a version without memory leak ?

 

Thanks again for any help,

Best Regards.

0 Kudos
Message 3 of 4
(3,507 Views)

Dear ALL:

      I also meet this question when using imaqStraightEdge,

 

 StraightEdgeReport2* edgereport=NULL;

 edgereport=imaqStraightEdge(searchImage,roi1,IMAQ_SEARCH_DIRECTION_RIGHT_TO_LEFT,&edgeOptions,&straightEdgeOptions);
 startX=edgereport->straightEdges->straightEdgeCoordinates.start.x;
 startY=edgereport->straightEdges->straightEdgeCoordinates.start.y;
 endX=edgereport->straightEdges->straightEdgeCoordinates.end.x;
 endY=edgereport->straightEdges->straightEdgeCoordinates.end.y;

 

 

 

the red color code may cause the Access error!

Thanks for any help......

 

 

0 Kudos
Message 4 of 4
(3,170 Views)