{
url = p_plugin->getAbsoluteURL(s);
if( url )
- delete s;
+ free(s);
else
// problem with combining url, use argument
url = s;
}
else
{
- delete url;
+ free(url);
return INVOKERESULT_INVALID_VALUE;
}
}
}
else
{
- delete url;
- delete name;
+ free(url);
+ free(name);
return INVOKERESULT_INVALID_VALUE;
}
}
i_options,
const_cast<const char **>(ppsz_options),
&ex);
- delete url;
- delete name;
+ free(url);
+ free(name);
for( int i=0; i< i_options; ++i )
{
- delete ppsz_options[i];
+ free(ppsz_options[i]);
}
- delete ppsz_options;
+ free(ppsz_options);
if( libvlc_exception_raised(&ex) )
{
if( ! moreOptions )
{
/* failed to allocate more memory */
- delete s;
+ free(s);
/* return what we got so far */
*i_options = nOptions;
*ppsz_options = options;
*i_options = nOptions;
*ppsz_options = options;
}
- delete s;
+ free(s);
}
}
}
}
libvlc_video_set_aspect_ratio(p_md, psz_aspect, &ex);
- delete psz_aspect;
+ free(psz_aspect);
libvlc_media_player_release(p_md);
if( libvlc_exception_raised(&ex) )
}
libvlc_video_set_crop_geometry(p_md, psz_geometry, &ex);
- delete psz_geometry;
+ free(psz_geometry);
libvlc_media_player_release(p_md);
if( libvlc_exception_raised(&ex) )
char* RuntimeNPObject::stringValue(const NPString &s)
{
- NPUTF8 *val = new NPUTF8[s.utf8length+1];
+ NPUTF8 *val = static_cast<NPUTF8*>(malloc((s.utf8length+1) * sizeof(*val)));
if( val )
{
strncpy(val, s.utf8characters, s.utf8length);
NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
{
/* prepare VLC command line */
- char *ppsz_argv[32];
+ const char *ppsz_argv[32];
int ppsz_argc = 0;
/* locate VLC module path */
{
NPString &location = NPVARIANT_TO_STRING(result);
- psz_baseURL = new char[location.utf8length+1];
+ psz_baseURL = static_cast<char*>(malloc(location.utf8length+1));
if( psz_baseURL )
{
strncpy(psz_baseURL, location.utf8characters, location.utf8length);
VlcPlugin::~VlcPlugin()
{
- delete[] psz_baseURL;
- delete psz_target;
+ free(psz_baseURL);
+ free(psz_target);
if( libvlc_log )
libvlc_log_close(libvlc_log, NULL);
if( libvlc_instance )
if( psz_baseURL )
{
size_t baseLen = strlen(psz_baseURL);
- char *href = new char[baseLen+strlen(url)+1];
+ char *href = static_cast<char*>(malloc(baseLen+strlen(url)+1));
if( href )
{
/* prepend base URL */
if( '/' != *href )
{
/* baseURL is not an absolute path */
- delete[] href;
+ free(href);
return NULL;
}
pathstart = href;