yiguolei commented on code in PR #19116:
URL: https://github.com/apache/doris/pull/19116#discussion_r1177751220


##########
be/src/geo/wkb_parse.cpp:
##########
@@ -150,30 +150,30 @@ GeoShape* WkbParse::readGeometry(WkbParseContext* ctx) {
 
     uint32_t geometryType = (typeInt & 0xffff) % 1000;
 
-    GeoShape* shape;
+    std::unique_ptr<GeoShape> shape;
 
     switch (geometryType) {
     case wkbType::wkbPoint:
-        shape = readPoint(ctx);
+        shape.reset(readPoint(ctx));
         break;
     case wkbType::wkbLine:
-        shape = readLine(ctx);
+        shape.reset(readLine(ctx));
         break;
     case wkbType::wkbPolygon:
-        shape = readPolygon(ctx);
+        shape.reset(readPolygon(ctx));
         break;
     default:
         return nullptr;
     }
-    return shape;
+    return shape.release();

Review Comment:
   make  readGeometry method return std::unique_ptr<GeoShape>?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to