修改分支codecheck问题,回退两个makeke_shared构建对象

Signed-off-by: guduhanyan <xuyanjun27@163.com>
This commit is contained in:
guduhanyan
2022-02-17 17:19:04 +08:00
parent 89e6a1a092
commit 936339771f
3 changed files with 8 additions and 13 deletions
-5
View File
@@ -17,13 +17,8 @@
#include <cinttypes>
#include <mutex>
#include <thread>
#include <atomic>
#include <vector>
#include <chrono>
#include <functional>
#include <map>
#include <random>
#include "batch.h"
#include "timer_handler.h"
+7 -7
View File
@@ -13,18 +13,18 @@
* limitations under the License.
*/
#include <sys/epoll.h>
#include <iostream>
#include <cstring>
#include <sys/timerfd.h>
#include <unistd.h>
#include <linux/rtc.h>
#include <cstring>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <dirent.h>
#include <sys/epoll.h>
#include <sys/timerfd.h>
#include <sys/time.h>
#include <dirent.h>
#include <sstream>
#include <fstream>
#include <iostream>
#include <linux/rtc.h>
#include "timer_handler.h"
namespace OHOS {
@@ -65,7 +65,7 @@ std::shared_ptr<TimerHandler> TimerHandler::Create()
}
}
std::shared_ptr<TimerHandler> handler = std::make_shared<TimerHandler>(fds, epollfd);
std::shared_ptr<TimerHandler> handler = std::shared_ptr<TimerHandler>(new TimerHandler(fds, epollfd));
for (size_t i = 0; i < fds.size(); i++) {
epoll_event event {};
event.events = EPOLLIN | EPOLLWAKEUP;
+1 -1
View File
@@ -52,7 +52,7 @@ std::shared_ptr<TimerManager> TimerManager::Create()
TIME_HILOGE(TIME_MODULE_SERVICE, "Create Timer handle failed.");
return nullptr;
}
return std::make_shared<TimerManager>(impl);
return std::shared_ptr<TimerManager>(new TimerManager(impl));
}
TimerManager::TimerManager(std::shared_ptr<TimerHandler> impl)