@@ -31,7 +31,10 @@ namespace pew::eos::config
3131{
3232 struct WindowsConfig final : PlatformConfig
3333 {
34- ~WindowsConfig () = default ;
34+ ~WindowsConfig () override
35+ {
36+ delete static_cast <EOS_Windows_RTCOptions*>(platform_specific_rtc_options);
37+ }
3538
3639 void set_cache_directory () override
3740 {
@@ -47,7 +50,7 @@ namespace pew::eos::config
4750 }
4851 }
4952
50- void set_platform_specific_rtc_options () const override
53+ void set_platform_specific_rtc_options () override
5154 {
5255 if (rtc_options == nullptr )
5356 {
@@ -57,9 +60,9 @@ namespace pew::eos::config
5760
5861 if (rtc_options->PlatformSpecificOptions == nullptr )
5962 {
60- s_platform_specific_rtc_options = new EOS_Windows_RTCOptions ();
63+ platform_specific_rtc_options = new EOS_Windows_RTCOptions ();
6164
62- const auto windows_rtc_options = reinterpret_cast <EOS_Windows_RTCOptions*>(s_platform_specific_rtc_options );
65+ const auto windows_rtc_options = static_cast <EOS_Windows_RTCOptions*>(platform_specific_rtc_options );
6366
6467 windows_rtc_options->ApiVersion = EOS_WINDOWS_RTCOPTIONS_API_LATEST;
6568
@@ -71,23 +74,22 @@ namespace pew::eos::config
7174 }
7275
7376 size_t len = xaudio2_dll_path.string ().size () + 1 ;
74- s_xaudio2_dll_path = std::unique_ptr <char []>(new char [len]);
77+ _xaudio2_dll_path = std::shared_ptr <char []>(new char [len]);
7578
76- strcpy_s (s_xaudio2_dll_path .get (), len, xaudio2_dll_path.string ().c_str ());
79+ strcpy_s (_xaudio2_dll_path .get (), len, xaudio2_dll_path.string ().c_str ());
7780
78- windows_rtc_options->XAudio29DllPath = s_xaudio2_dll_path .get ();
81+ windows_rtc_options->XAudio29DllPath = _xaudio2_dll_path .get ();
7982
80- rtc_options->PlatformSpecificOptions = s_platform_specific_rtc_options ;
83+ rtc_options->PlatformSpecificOptions = platform_specific_rtc_options ;
8184 }
8285 }
8386
8487 private:
8588
86- static inline std::unique_ptr <char []> s_xaudio2_dll_path ;
89+ std::shared_ptr <char []> _xaudio2_dll_path ;
8790
8891 explicit WindowsConfig () : PlatformConfig(" eos_windows_config.json" )
8992 {
90- get_cache_directory ();
9193 }
9294 // Makes the WindowsConfig constructor accessible to the Config class.
9395 friend struct Config ;
0 commit comments