File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ With that in mind, let’s learn about lifetimes.
43
43
Lending out a reference to a resource that someone else owns can be
44
44
complicated. For example, imagine this set of operations:
45
45
46
- - I acquire a handle to some kind of resource.
47
- - I lend you a reference to the resource.
48
- - I decide I’m done with the resource, and deallocate it, while you still have
46
+ 1 . I acquire a handle to some kind of resource.
47
+ 2 . I lend you a reference to the resource.
48
+ 3 . I decide I’m done with the resource, and deallocate it, while you still have
49
49
your reference.
50
- - You decide to use the resource.
50
+ 4 . You decide to use the resource.
51
51
52
52
Uh oh! Your reference is pointing to an invalid resource. This is called a
53
53
dangling pointer or ‘use after free’, when the resource is memory.
You can’t perform that action at this time.
0 commit comments