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
112
112
### Upcoming
113
113
- Changes
114
114
- 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 ) ).
115
117
116
118
### 13.2.0
117
119
- Changes
Original file line number Diff line number Diff line change @@ -179,8 +179,20 @@ public:
179
179
if (g_message_received_callback) {
180
180
// Copy the message so that it can be owned and cleaned up by the C#
181
181
// 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
+ }
184
196
// If the callback didn't take ownership of the message, delete it.
185
197
if (!g_message_received_callback (copy)) {
186
198
delete copy;
You can’t perform that action at this time.
0 commit comments