File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,9 @@ @implementation Observer
10
10
- (void )observeValueForKeyPath : (NSString *)keyPath ofObject : (id )object change : (NSDictionary *)change context : (void *)context ;
11
11
{
12
12
13
- @autoreleasepool {
14
- if ([keyPath isEqualToString: @" state" ]) {
15
- int newState = (int )[change[NSKeyValueChangeNewKey ] integerValue ];
16
- changeStateOnObserver (newState, context);
17
- } else {
18
- // bool canVal = (bool)[change[NSKeyValueChangeNewKey] boolValue];
19
- // char *vmid = copyCString((NSString *)context);
20
- // char *key = copyCString(keyPath);
21
- // changeCanPropertyOnObserver(canVal, vmid, key);
22
- // free(vmid);
23
- // free(key);
24
- }
13
+ if ([keyPath isEqualToString: @" state" ]) {
14
+ int newState = (int )[change[NSKeyValueChangeNewKey ] integerValue ];
15
+ changeStateOnObserver (newState, context);
25
16
}
26
17
}
27
18
@end
@@ -46,9 +37,9 @@ - (instancetype)initWithConfiguration:(VZVirtualMachineConfiguration *)configura
46
37
- (void )dealloc
47
38
{
48
39
[self removeObserver: _observer forKeyPath: @" state" ];
49
- deleteStateHandler (_stateHandler);
50
40
[_observer release ];
51
41
[super dealloc ];
42
+ deleteStateHandler (_stateHandler);
52
43
}
53
44
@end
54
45
You can’t perform that action at this time.
0 commit comments