Skip to content

Commit 99066ad

Browse files
committed
Revert "Fix initialization-order-fiasco"
This reverts commit e9510a2.
1 parent 2a4fa19 commit 99066ad

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/app/server/Server.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class DeviceTypeResolver : public chip::Access::AccessControl::DeviceTypeResolve
8787

8888
namespace chip {
8989

90+
Server Server::sServer;
91+
9092
#if CHIP_CONFIG_ENABLE_SERVER_IM_EVENT
9193
#define CHIP_NUM_EVENT_LOGGING_BUFFERS 3
9294
static uint8_t sInfoEventBuffer[CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE];

src/app/server/Server.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,13 @@ class Server
398398
return System::SystemClock().GetMonotonicMicroseconds64() - mInitTimestamp;
399399
}
400400

401-
static Server & GetInstance() {
402-
static Server sServer = new Server();
403-
return *sServer;
404-
}
401+
static Server & GetInstance() { return sServer; }
405402

406403
private:
407404
Server() {}
408405

406+
static Server sServer;
407+
409408
void InitFailSafe();
410409
void OnPlatformEvent(const DeviceLayer::ChipDeviceEvent & event);
411410
void CheckServerReadyEvent();

0 commit comments

Comments
 (0)