summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a89c51)
raw | patch | inline | side by side (parent: 7a89c51)
author | scislac <scislac@users.sourceforge.net> | |
Tue, 10 Jul 2007 20:39:45 +0000 (20:39 +0000) | ||
committer | scislac <scislac@users.sourceforge.net> | |
Tue, 10 Jul 2007 20:39:45 +0000 (20:39 +0000) |
src/extension/internal/emf-win32-inout.cpp | patch | blob | history |
diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp
index eb499588548c758c2b7ed05a34468460788421fd..59f538ab919a5cd109072d5e0443bba83b34ea35 100644 (file)
@@ -505,6 +505,15 @@ myEnhMetaFileProc(HDC hDC, HANDLETABLE *lpHTable, ENHMETARECORD *lpEMFR, int nOb
if (pEmr->nHandles) {
d->n_obj = pEmr->nHandles;
d->emf_obj = new EMF_OBJECT[d->n_obj];
+
+ // Init the new emf_obj list elements to null, provided the
+ // dynamic allocation succeeded.
+ if ( d->emf_obj != NULL )
+ {
+ for( unsigned int i=0; i < d->n_obj; ++i )
+ d->emf_obj[i].lpEMFR = NULL;
+ } //if
+
} else {
d->emf_obj = NULL;
}
delete_object(&d, i);
delete[] d.emf_obj;
}
-
+
if (d.style.stroke_dash.dash)
delete[] d.style.stroke_dash.dash;