File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,8 @@ Release Notes
112112### Upcoming
113113- Changes
114114 - Firebase AI: Add support for enabling the model to use Code Execution.
115+ - Messaging: Fix crash when deleting a Message with a Notification.
116+ ([ #1334 ] ( https://github.com/firebase/firebase-unity-sdk/issues/1334 ) ).
115117
116118### 13.2.0
117119- Changes
Original file line number Diff line number Diff line change @@ -179,8 +179,20 @@ public:
179179 if (g_message_received_callback) {
180180 // Copy the message so that it can be owned and cleaned up by the C#
181181 // proxy object.
182- Message *copy = new Message ();
183- *copy = *reinterpret_cast <Message*>(message);
182+ Message* original = reinterpret_cast <Message*>(message);
183+ Message* copy = new Message ();
184+ *copy = *original;
185+ // If there is a notification, create a copy of that too
186+ if (original->notification ) {
187+ copy->notification = new Notification ();
188+ *copy->notification = *original->notification ;
189+
190+ // Then, if there is an AndroidNotificationParams, we need to copy that too
191+ if (original->notification ->android ) {
192+ copy->notification ->android = new AndroidNotificationParams ();
193+ *copy->notification ->android = *original->notification ->android ;
194+ }
195+ }
184196 // If the callback didn't take ownership of the message, delete it.
185197 if (!g_message_received_callback (copy)) {
186198 delete copy;
You can’t perform that action at this time.
0 commit comments