summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2016-08-17 07:37:48 +0000
committertavmjong-free <tavmjong@free.fr>2016-08-17 07:37:48 +0000
commit65477c4c8456ceb7ee9d1e630421d4d5c79619dc (patch)
treee21e8b4431f00e3e5213462332f733448e8b9486 /src
parentAdd Shift+drag to arc start and end knots, holding shift will now move both k... (diff)
downloadinkscape-65477c4c8456ceb7ee9d1e630421d4d5c79619dc.tar.gz
inkscape-65477c4c8456ceb7ee9d1e630421d4d5c79619dc.zip
Add std::nothrow so tests of memory allocation work as expected.
Should eventually be replaced by smart pointers. (bzr r15062)
Diffstat (limited to 'src')
-rw-r--r--src/io/gzipstream.cpp8
-rw-r--r--src/sp-lpe-item.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/io/gzipstream.cpp b/src/io/gzipstream.cpp
index 380c42411..330191ecd 100644
--- a/src/io/gzipstream.cpp
+++ b/src/io/gzipstream.cpp
@@ -171,12 +171,12 @@ bool GzipInputStream::load()
}
srcLen = inputBuf.size();
- srcBuf = new Byte [srcLen];
+ srcBuf = new (std::nothrow) Byte [srcLen];
if (!srcBuf) {
return false;
}
- outputBuf = new unsigned char [OUT_SIZE];
+ outputBuf = new (std::nothrow) unsigned char [OUT_SIZE];
if ( !outputBuf ) {
delete[] srcBuf;
srcBuf = NULL;
@@ -386,14 +386,14 @@ void GzipOutputStream::flush()
}
uLong srclen = inputBuf.size();
- Bytef *srcbuf = new Bytef [srclen];
+ Bytef *srcbuf = new (std::nothrow) Bytef [srclen];
if (!srcbuf)
{
return;
}
uLong destlen = srclen;
- Bytef *destbuf = new Bytef [(destlen + (srclen/100) + 13)];
+ Bytef *destbuf = new (std::nothrow) Bytef [(destlen + (srclen/100) + 13)];
if (!destbuf)
{
delete[] srcbuf;
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 44dc684c9..85df070b8 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -703,7 +703,7 @@ SPLPEItem::apply_to_clip_or_mask(SPItem *clip_mask, SPItem *item)
// LPE was unsuccesfull. Read the old 'd'-attribute.
if (gchar const * value = repr->attribute("d")) {
Geom::PathVector pv = sp_svg_read_pathv(value);
- SPCurve *oldcurve = new SPCurve(pv);
+ SPCurve *oldcurve = new (std::nothrow) SPCurve(pv);
if (oldcurve) {
SP_SHAPE(clip_mask)->setCurve(oldcurve, TRUE);
oldcurve->unref();