@@ -45,13 +45,20 @@ static const std::vector<MSI_ZONE> zone_set1 =
4545 MSI_ZONE_JARGB_3,
4646};
4747
48- static const std::string board_names[] = { " MSI MAG X870 TOMAHAWK WIFI (MS-7E51)" , " MSI MAG B850M MORTAR WIFI (MS-7E61)" , " MSI MPG B850I EDGE TI WIFI (MS-7E79)" };
48+ static const std::string board_names[] =
49+ {
50+ " MSI MAG X870 TOMAHAWK WIFI (MS-7E51)" ,
51+ " MSI MAG B850M MORTAR WIFI (MS-7E61)" ,
52+ " MSI MPG B850I EDGE TI WIFI (MS-7E79)" ,
53+ " MSI X870 GAMING PLUS WIFI (MS-7E47)"
54+ };
4955
5056static const mystic_light_761_config board_configs[] =
5157{
5258 { &(board_names[0 ]), 0 , 0 , 0 , 1 , &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI X870 TOMAHAWK WIFI
5359 { &(board_names[1 ]), 0 , 0 , 0 , 1 , &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MAG B850M MORTAR WIFI
5460 { &(board_names[2 ]), 0 , 0 , 0 , 1 , &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MPG B850I EDGE TI WIFI
61+ { &(board_names[3 ]), 0 , 0 , 0 , 1 , &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI X870 GAMING PLUS WIFI
5562};
5663
5764
@@ -153,8 +160,6 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
153160 location = path;
154161 name = dev_name;
155162
156- supported_zones = new std::vector<MSI_ZONE>;
157-
158163 const mystic_light_761_config * board_config = nullptr ;
159164 for (int i = 0 ; i < NUM_CONFS; i++)
160165 {
@@ -232,8 +237,6 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
232237 int res = hid_send_feature_report (dev, conf_arr, SETUP_ARRAY_SIZE);
233238 LOG_INFO (" Sending configuration resulted in %i\n " , res);
234239
235- free (conf_arr);
236-
237240 data = new FeaturePacket_761;
238241
239242 data->jaf .zone = MSI_ZONE_JAF;
@@ -256,6 +259,8 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
256259 init_packet (&data->jargb2 );
257260 init_packet (&data->jargb3 );
258261 }
262+
263+ free (conf_arr);
259264 }
260265 else
261266 {
@@ -267,6 +272,22 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
267272MSIMysticLight761Controller::~MSIMysticLight761Controller ()
268273{
269274 hid_close (dev);
275+
276+ if (data)
277+ {
278+ delete data;
279+ data = nullptr ;
280+ }
281+
282+ for (ZoneConfig& zone : zone_configs)
283+ {
284+ if (zone.zone_data )
285+ {
286+ delete zone.zone_data ;
287+ zone.zone_data = nullptr ;
288+ }
289+ }
290+ zone_configs.clear ();
270291}
271292
272293void MSIMysticLight761Controller::SetMode
0 commit comments