@@ -143,7 +143,6 @@ breakpad_backend_callback(const google_breakpad::MinidumpDescriptor &descriptor,
143143 }
144144
145145 if (should_handle) {
146- sentry_value_incref (event);
147146 sentry_envelope_t *envelope = sentry__prepare_event (
148147 options, event, nullptr , !options->on_crash_func , NULL );
149148 sentry_session_t *session = sentry__end_current_session_with_status (
@@ -177,27 +176,30 @@ breakpad_backend_callback(const google_breakpad::MinidumpDescriptor &descriptor,
177176 sentry__attachment_free (screenshot);
178177 }
179178
180- // capture the envelope with the disk transport
181- sentry_transport_t *disk_transport
182- = sentry_new_disk_transport (options->run );
183- sentry__capture_envelope (disk_transport, envelope);
184- sentry__transport_dump_queue (disk_transport, options->run );
185- sentry_transport_free (disk_transport);
179+ if (options->feedback_handler_path ) {
180+ sentry__launch_feedback_handler (envelope);
181+ } else {
182+ // capture the envelope with the disk transport
183+ sentry_transport_t *disk_transport
184+ = sentry_new_disk_transport (options->run );
185+ sentry__capture_envelope (disk_transport, envelope);
186+ sentry__transport_dump_queue (disk_transport, options->run );
187+ sentry_transport_free (disk_transport);
188+ }
186189
187190 // now that the envelope was written, we can remove the temporary
188191 // minidump file
189192 sentry__path_remove (dump_path);
190193 sentry__path_free (dump_path);
191194 } else {
192195 SENTRY_DEBUG (" event was discarded by the `on_crash` hook" );
196+ sentry_value_decref (event);
193197 }
194198
195199 // after capturing the crash event, try to dump all the in-flight
196200 // data of the previous transports
197201 sentry__transport_dump_queue (options->transport , options->run );
198- // and launch the feedback handler
199- sentry__launch_feedback_handler (event);
200- sentry_value_decref (event);
202+ // and restore the old transport
201203 }
202204 SENTRY_INFO (" crash has been captured" );
203205
0 commit comments