rough-minister-58256
06/13/2018, 5:56 AMrough-minister-58256
06/13/2018, 6:00 AMimage.png▾
rough-minister-58256
06/13/2018, 6:00 AMrough-minister-58256
06/13/2018, 6:05 AMrough-minister-58256
06/13/2018, 6:51 AMself
rough-minister-58256
06/13/2018, 6:56 AMaverage-vr-56795
06/13/2018, 8:24 AMaverage-vr-56795
06/13/2018, 8:25 AMand_then
block will be run off-thread, there are no guarantees that the object referred to as self
actually exists which that callback in scheduled.average-vr-56795
06/13/2018, 8:26 AM&self
(reference to thing which must exist) to self
(single owned reference of thing, which I can continue to own, move around on the stack, and guarantee exists when the closure runs) fixes the problem, but means that that CommandRunner
can’t be used by anyone else after that callaverage-vr-56795
06/13/2018, 8:27 AMself
reference, the way to do that would’ve been, before the and_then
call, to write let runner2 = self.clone();
which gives you a new instance of CommandRunner
which you can then move into the closure, and use runner2
any time you want to use self
in that closurerough-minister-58256
06/13/2018, 8:27 AMand_then
dawned on me laterough-minister-58256
06/13/2018, 8:28 AMaverage-vr-56795
06/13/2018, 8:28 AMself
that you’re leaking, the error message at least includes the name of the type of the thing you’re leaking (and sometimes even a pointer at the variable), but for some reason the error is much worse if it’s self
average-vr-56795
06/13/2018, 8:28 AMself
references 🙂rough-minister-58256
06/13/2018, 8:29 AMaverage-vr-56795
06/13/2018, 8:29 AMrough-minister-58256
06/13/2018, 8:31 AMrough-minister-58256
06/13/2018, 8:33 AMaverage-vr-56795
06/13/2018, 8:33 AMaloof-angle-91616
06/13/2018, 5:39 PMaloof-angle-91616
06/13/2018, 5:40 PMrough-minister-58256
06/13/2018, 5:40 PMwitty-crayon-22786
06/13/2018, 7:32 PMwitty-crayon-22786
06/13/2018, 7:33 PMwitty-crayon-22786
06/13/2018, 7:33 PMwitty-crayon-22786
06/13/2018, 7:33 PMrough-minister-58256
06/13/2018, 7:40 PMaloof-angle-91616
06/13/2018, 9:58 PMsed
now, but i was wondering if it would make more sense to maintain a github fork of the glibc git and key into the SHA of that repo, because the automated edits may break in future releases.aloof-angle-91616
06/13/2018, 9:59 PMrough-minister-58256
06/13/2018, 10:58 PM