Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it safe to create a CNiVector in one thread, but free it in another?

HI,

 

I created a CNiVector in a thread by "new CNiInt16Vector(size)" in one thread, and populated it with data to be displayed in the UI thread. In the UI thread, the CNiInt16Vector data was plotted in a CNiGraph control, and then the CNiInt16Vector was deleted in the UI thread. Most of time my program runs ok, but occasionally it crashes at "new CNiInt16Vector(size)" when the size of the vector differs from the last one. Would you please confirm if I can create a CNiVector in one thread, but free it in another?

 

 

Thanks,

-Ao

0 Kudos
Message 1 of 1
(5,425 Views)