X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/0a7de7458d150b5d4dffc935ba399be265ef0a1a..c3c9b80d004dbbfdf763edeb97968c6997e3b45b:/iokit/Kernel/IOSimpleReporter.cpp diff --git a/iokit/Kernel/IOSimpleReporter.cpp b/iokit/Kernel/IOSimpleReporter.cpp index 7807763a9..fc29f24c3 100644 --- a/iokit/Kernel/IOSimpleReporter.cpp +++ b/iokit/Kernel/IOSimpleReporter.cpp @@ -26,6 +26,9 @@ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ +#define IOKIT_ENABLE_SHARED_PTR + +#include #include #include #include "IOReporterDefs.h" @@ -34,34 +37,23 @@ OSDefineMetaClassAndStructors(IOSimpleReporter, IOReporter); /* static */ -IOSimpleReporter* +OSSharedPtr IOSimpleReporter::with(IOService *reportingService, IOReportCategories categories, IOReportUnit unit) { - IOSimpleReporter *reporter, *rval = NULL; - - // kprintf("%s\n", __func__); // can't IORLOG() from static + OSSharedPtr reporter; - reporter = new IOSimpleReporter; + reporter = OSMakeShared(); if (!reporter) { - goto finish; + return nullptr; } - if (!reporter->initWith(reportingService, categories, unit)) { - goto finish; - } - - // success - rval = reporter; - -finish: - if (!rval) { - OSSafeReleaseNULL(reporter); + return nullptr; } - return rval; + return reporter; } bool