Creating and Disposing of a URL Reference


Mac OS X header: Carbon/Carbon.h
Mac OS 9 header: URLAccess.h


Creating and Disposing of a URL Reference Functions
URLNewReference Creates a URL reference.
URLDisposeReference Disposes of the memory associated with a URL reference.


URLNewReference

Carbon status: Supported

Creates a URL reference.

OSStatus URLNewReference (
    const char *url, 
    URLReference *urlRef
);
Parameter descriptions
url

A pointer to a C string representing the name of the URL you want to create.

urlRef

On return, a pointer to the newly-created URL reference.

function result

A result code.

Discussion

The URLNewReference function creates a URL reference that you can use in subsequent calls to the URL Access Manager. When you no longer need a URL reference, you should dispose of its memory by calling the function URLDisposeReference.

Availability

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


URLDisposeReference

Carbon status: Supported

Disposes of the memory associated with a URL reference.

OSStatus URLDisposeReference (
    URLReference urlRef
);
Parameter descriptions
urlRef

A reference to the URL whose associated memory you wish to dispose of. You should call the URLDisposeReference function to release the memory occupied by a URL reference when you are finished with it.

function result

A result code.

Availability

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.

Special Considerations

You must call the URLDisposeReference function to dispose of the reference associated with a URL reference even if the data transfer operation fails. Failure to call URLDisposeReference may result in thread or memory leaks.


© 2001 Apple Computer, Inc. (Last Updated July 21, 2001)