cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Where to call curl_global_cleanup in a UNIX shared library?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 1 Dec 2001 12:42:55 +0100 (MET)

On Fri, 30 Nov 2001, Miklos Nemeth wrote:

> I'm developing a libcurl-based ecommerce library for a scripting
> engine, and implement my library as a shared object (DLL).
> It's clear that one can call curl_global_cleanup
> in the DllMain when the DLL is shut down.
>
> Is there similar point in UNIX shared libraries?

No. A shared library in unix is just a set of functions that you load
dynamicly.

You'll probably have to introduce your own library-init and library-cleanup
calls for the user of your library to call.

> Is it really mandatory to call curl_global_cleanup?

If your program is gonna exit anyway (and thus free/close all resources), it
doesn't matter. If your program plans to call curl_global_init() again, you
better make sure cleanup was called first.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-12-01