Sunday, 15 February 2015

c++ - Do all the pointer variables inside a program got deleted after sudden crash? -



c++ - Do all the pointer variables inside a program got deleted after sudden crash? -

i have ip based camera( basler ace2000-50gm) connected embedded board runs ubuntu 12.04 64bit . managed configure according documentation , can grab frames @ frame rate kind of parameters like. (i used c++ apis)

here initializing code:

typedef pylon::cbaslergigeinstantcamera camera_t; void cam_init() { bool camera_initialization = false; camera_t *camera; photographic camera = new camera_t(); pyloninitialize(); do{ if(!camera_initialization) { seek { ctlfactory& tlfactory = ctlfactory::getinstance(); // attached devices , exit application if no device found. deviceinfolist_t devices; qdebug("detecting photographic camera ...."); if ( tlfactory.enumeratedevices(devices) == 0 ) { throw runtime_exception( "no photographic camera present."); } photographic camera = new camera_t( tlfactory.createdevice( devices[0 ]) ); camera->open(); cacquirecontinuousconfiguration().onopened( *camera); camera->startgrabbing( grabstrategy_upcomingimage); camera_initialization = true; qdebug("camera configured successfully"); } catch( genericexception &e ) { interface<< "**** exception occurred! desription is: " << "\n"<< " " << e.getdescription() << "\n"; } } }while(!camera_initialization); }

this code part of big program.

the problem programme crashes (i haven't found sourceyet) , when rerun code doesn't observe photographic camera till 5 minutes or more has passed since lastly crash !!! gives next error message

**** exception occurred! desription is: failed open 'basler aca2000-50gm#00305316a684#10.136.18.100:3956'. device controlled application. err: gx status 0xe1018006 (0xe1018006)

as have seen code initializing camera,i've used pointer object connect photographic camera , think when code crashes pointer not deleted photographic camera not available !

i think it's kind of network problem , don't know how solve it. when programme crashesh tried every different way restart networking services in ubuntu such as:

sudo service network-manager restart sudo ifdown eth0 && sudo ifup eth0 . . .

but none of them worked me , still when programme crashes takes more 5 minutes able run program.

it amazing after 5 minutes code detects photographic camera correctly , i'm able run code. tried zillion times , must remain @ to the lowest degree 5 minutes run code observe photographic camera !!!(it repeats show above error message next 5 min ) ran code many times in own laptop , pc after code crash can run code without problem think problem lies embedded board network !

i thought every kind of variables gets deleted after terminating programme seems it's kind of wrong think !

i can provide info want solve problem. thanks

the memory freed, destructors not run. probably, destructor informs scheme no longer controlling device.

i consider bug in system. fact specific process controlling device should behave much open, , if process crashes, detached. (under unix, done implementing sort of pseudo-device, example.)

c++ linux networking ip-camera

1 comment: