Bug 1280443: Copy this the hard way. r=drno a=sylvestre
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 10 Aug 2016 11:51:28 -0500
changeset 347624 3e188ed421a096c8917c556ff2ad6b42b3f35868
parent 347623 7f3c63f9f8a9c95c24ce516168ce9a5539b854a5
child 347625 352ba6b9460229871e3031e19f6fcc2c6a6afb25
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, sylvestre
bugs1280443
milestone50.0a2
Bug 1280443: Copy this the hard way. r=drno a=sylvestre
media/mtransport/third_party/nICEr/src/ice/ice_media_stream.c
--- a/media/mtransport/third_party/nICEr/src/ice/ice_media_stream.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_media_stream.c
@@ -889,20 +889,27 @@ int nr_ice_media_stream_disable_componen
     return(_status);
   }
 
 void nr_ice_media_stream_role_change(nr_ice_media_stream *stream)
   {
     nr_ice_cand_pair *pair,*temp_pair;
     /* Changing role causes candidate pair priority to change, which requires
      * re-sorting the check list. */
-    nr_ice_cand_pair_head old_checklist=stream->check_list;
-    TAILQ_INIT(&stream->check_list);
+    nr_ice_cand_pair_head old_checklist;
 
     assert(stream->ice_state != NR_ICE_MEDIA_STREAM_UNPAIRED);
 
+    /* Move check_list to old_checklist (not POD, have to do the hard way) */
+    TAILQ_INIT(&old_checklist);
+    TAILQ_FOREACH_SAFE(pair,&stream->check_list,check_queue_entry,temp_pair) {
+      TAILQ_REMOVE(&stream->check_list,pair,check_queue_entry);
+      TAILQ_INSERT_TAIL(&old_checklist,pair,check_queue_entry);
+    }
+
+    /* Re-insert into the check list */
     TAILQ_FOREACH_SAFE(pair,&old_checklist,check_queue_entry,temp_pair) {
       TAILQ_REMOVE(&old_checklist,pair,check_queue_entry);
       nr_ice_candidate_pair_role_change(pair);
       nr_ice_candidate_pair_insert(&stream->check_list,pair);
     }
   }