Quellcode durchsuchen

LibIPC: Make Connection::send_sync return a NonnullOwnPtr

Since we VERIFY that we received a response, the response pointer is
always non-null.
Idan Horowitz vor 4 Jahren
Ursprung
Commit
28b8a2ec7a
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      Userland/Libraries/LibIPC/Connection.h

+ 2 - 2
Userland/Libraries/LibIPC/Connection.h

@@ -118,12 +118,12 @@ public:
     }
 
     template<typename RequestType, typename... Args>
-    OwnPtr<typename RequestType::ResponseType> send_sync(Args&&... args)
+    NonnullOwnPtr<typename RequestType::ResponseType> send_sync(Args&&... args)
     {
         post_message(RequestType(forward<Args>(args)...));
         auto response = wait_for_specific_endpoint_message<typename RequestType::ResponseType, PeerEndpoint>();
         VERIFY(response);
-        return response;
+        return response.release_nonnull();
     }
 
     template<typename RequestType, typename... Args>