[haiku-commits] r39930 - haiku/trunk/src/servers/app

Author: mmlr
Date: 2010-12-24 02:13:28 +0100 (Fri, 24 Dec 2010)
New Revision: 39930
Changeset: http://dev.haiku-os.org/changeset/39930

Modified:
   haiku/trunk/src/servers/app/ServerApp.cpp
Log:
* CID 8120: The size supplied to the attach call was the one of the pointer, so
  the data was never correctly attached.
* CID 5886 and 5887: escapements and offsets were not freed in the error case.


Modified: haiku/trunk/src/servers/app/ServerApp.cpp
===================================================================
--- haiku/trunk/src/servers/app/ServerApp.cpp   2010-12-24 00:58:57 UTC (rev 
39929)
+++ haiku/trunk/src/servers/app/ServerApp.cpp   2010-12-24 01:13:28 UTC (rev 
39930)
@@ -1868,9 +1868,8 @@
 
                        fLink.Flush();
 
-                       for (int32 i = 0; i < numStrings; i++) {
+                       for (int32 i = 0; i < numStrings; i++)
                                free(stringArray[i]);
-                       }
                        break;
                }
 
@@ -2239,13 +2238,12 @@
                                        }
                                } else
                                        fLink.StartMessage(status);
-
-                               delete[] escapements;
-                               delete[] offsets;
                        } else
                                fLink.StartMessage(status);
 
                        delete[] charArray;
+                       delete[] escapements;
+                       delete[] offsets;
                        fLink.Flush();
                        break;
                }
@@ -2406,8 +2404,11 @@
                                        if (font.GetBoundingBoxes(charArray, 
numBytes,
                                                        rectArray, 
stringEscapement, mode, delta,
                                                        code == 
AS_GET_BOUNDINGBOXES_STRING) == B_OK) {
+
                                                fLink.StartMessage(B_OK);
-                                               fLink.Attach(rectArray, 
sizeof(rectArray));
+                                               for (int32 i = 0; i < numChars; 
i++)
+                                                       
fLink.Attach<BRect>(rectArray[i]);
+
                                                success = true;
                                        }
                                }


Other related posts: