On Tuesday 24 of November 2009 01:50:02 Dantzler, DeWayne C wrote: > I'm using libcurl with C++ classes in a single threaded application by > setting up the curl env in the constructor and invoking cleanup operation > in the destructor, but I'm having trouble freeing the allocated memory. I > read the curl documentation and tutorial. What is the correct method of > freeing resources?
It doesn't matter what programming paradigma are you actually using. Just call curl_global_init()/curl_easy_cleanup() once per whole program. A singleton might be a good candidate if you like clean object-oriented design? Then for each curl_easy_init() you should call one curl_easy_cleanup(). You can wrap it to class and call the functions in its ctor/dtor. Or perhaps use cURLpp binding which does the job for you? Kamil ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
