Long exit from program (long runtime exit). after save SVM opencv it is take long time to exit program

asked 2016-08-07 21:10:08 -0600

tiziran gravatar image

I used SVM in OpenCV 3.x and after save SVM, the program takes long time to exit:

Ptr<TrainData> td1 = TrainData::create(trainingDataMat, ROW_SAMPLE, labelsMat);
svm->trainAuto(td1);
cout << " save svm" << endl;
svm->save(fileSVM);

I used F10 to find problem and I found that

 #ifndef _CRT_APP
      exit(mainret);

may take this problem. How can solve this problem?

Thanks in advance.

edit retag flag offensive close merge delete

Comments

1

where did you find the exit code ? is it part of the opencv library ?

opencv / os / compiler versions ?

berak gravatar imageberak ( 2016-08-08 01:07:28 -0600 )edit

the code outside of my code. not in opencv library. opencv 3.1, windows 7, 64bit, visual studio 2013, c++

tiziran gravatar imagetiziran ( 2016-08-08 03:00:15 -0600 )edit
1

since this seems to be more a vs/win issue, - what kind of project do you use ? (you probably should start with an empty one)

berak gravatar imageberak ( 2016-08-08 03:14:52 -0600 )edit
1

I guess that exit(mainret); call is waiting untill the garbage collector has finished cleaning everything up periodically. Like @berak said, you would want a C++ project without extra code, to actually see if it is due to OpenCV or not!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-08-08 06:16:02 -0600 )edit