Home
RecentChanges

Search:

» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Download
»Learn to script
»FAQ
»Manual
»Discussion fora
»Project page
»External filters
»FeedBack

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth

 

Avisynth 
Logo

EnvSaveString

env->SaveString is given to allow users to pass strings to AVSValue, and ensure that they are being deallocated on unload.

An Example:

      fnpluginnew = new char[string_len];

      strcpy(fnpluginnew, fnplugin.AsString());
      strcat(fnpluginnew, " ");
      strcat(fnpluginnew, name);
      
      env->SetGlobalVar("$PluginFunctions$", AVSValue(env->SaveString(fnpluginnew, string_len)));

      // Since fnpluginnew has now been saved it can safely be deleted.

      delete[] fnpluginnew;

But you must still remember that these strings are not deallocated until the filter is unloaded.

So in general if you don't want your filter to be allocating more memory on each load, try avoiding using non-const strings.

Back to InternalFunctions

SourceForge Logo

 


Edit this document | View document history
Document last modified Mon, 10 Nov 2003 10:53:53