Skip to content

Commit 01f3948

Browse files
authored
Merge pull request #6 from RaspberryPiFoundation/fix-motorpair-segfault
Fix segfault in 0.2.5 by passing motor rather than port
2 parents 2c6f04a + 85baf89 commit 01f3948

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ MotorPair_init(MotorPairObject *self, PyObject *args, PyObject *kwds)
484484
if (cmd_connect_virtual_port(self->primary_id, self->secondary_id) < 0)
485485
return -1;
486486

487-
if (motor_ensure_mode_info(primary) < 0 ||
488-
motor_ensure_mode_info(secondary) < 0)
487+
if (motor_ensure_mode_info(port_get_motor(primary)) < 0 ||
488+
motor_ensure_mode_info(port_get_motor(secondary)) < 0)
489489
return -1;
490490

491491
return 0;

0 commit comments

Comments
 (0)