[cairo-commit] 2 commits - src/win32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Sep 3 12:55:07 UTC 2022


 src/win32/cairo-dwrite-font.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0e27a8046e4407329627a00a71dd9324ad671f62
Merge: 716c216eb 8266d2d5f
Author: Uli Schlachter <psychon at znc.in>
Date:   Sat Sep 3 12:55:05 2022 +0000

    Merge branch 'mismatched-new-delete' into 'master'
    
    Pair usage of operator new[] with a corresponding delete[]
    
    See merge request cairo/cairo!354

commit 8266d2d5f2d595ab4f77d6b5e08603b683141eb6
Author: Luca Bacci <luca.bacci982 at gmail.com>
Date:   Sat Sep 3 13:05:44 2022 +0200

    Pair usage of operator new[] with a corresponding delete[]

diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp
index c58827555..ea87fe7e1 100644
--- a/src/win32/cairo-dwrite-font.cpp
+++ b/src/win32/cairo-dwrite-font.cpp
@@ -330,7 +330,7 @@ _cairo_dwrite_font_face_create_for_toy (cairo_toy_font_face_t   *toy_face,
     MultiByteToWideChar(CP_UTF8, 0, toy_face->family, -1, face_name, face_name_len);
 
     RefPtr<IDWriteFontFamily> family = DWriteFactory::FindSystemFontFamily(face_name);
-    delete face_name;
+    delete[] face_name;
     if (!family) {
 	/* If the family is not found, use the default that should always exist. */
 	face_name_len = MultiByteToWideChar(CP_UTF8, 0, CAIRO_FONT_FAMILY_DEFAULT, -1, NULL, 0);
@@ -338,7 +338,7 @@ _cairo_dwrite_font_face_create_for_toy (cairo_toy_font_face_t   *toy_face,
 	MultiByteToWideChar(CP_UTF8, 0, CAIRO_FONT_FAMILY_DEFAULT, -1, face_name, face_name_len);
 
 	family = DWriteFactory::FindSystemFontFamily(face_name);
-	delete face_name;
+	delete[] face_name;
 	if (!family) {
 	    *font_face = (cairo_font_face_t*)&_cairo_font_face_nil;
 	    return (cairo_status_t)CAIRO_INT_STATUS_UNSUPPORTED;


More information about the cairo-commit mailing list