File tree 1 file changed +6
-5
lines changed
src/darwin/Framework/CHIP
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 35
35
// Reports attribute and event data if any exists
36
36
void MTRBaseSubscriptionCallback::ReportData ()
37
37
{
38
+ // At data reporting time, nil out scheduled or currently running interimReportBlock
39
+ if (mInterimReportBlock ) {
40
+ dispatch_block_cancel (mInterimReportBlock ); // no-op when running from mInterimReportBlock
41
+ mInterimReportBlock = nil ;
42
+ }
43
+
38
44
__block NSArray * attributeReports = mAttributeReports ;
39
45
mAttributeReports = nil ;
40
46
auto attributeCallback = mAttributeReportCallback ;
59
65
}
60
66
61
67
mInterimReportBlock = dispatch_block_create (DISPATCH_BLOCK_INHERIT_QOS_CLASS , ^{
62
- mInterimReportBlock = nil ;
63
68
ReportData ();
64
69
// Allocate reports arrays to continue accumulation
65
70
mAttributeReports = [NSMutableArray new ];
71
76
72
77
void MTRBaseSubscriptionCallback::OnReportEnd ()
73
78
{
74
- if (mInterimReportBlock ) {
75
- dispatch_block_cancel (mInterimReportBlock );
76
- mInterimReportBlock = nil ;
77
- }
78
79
ReportData ();
79
80
if (mReportEndHandler ) {
80
81
mReportEndHandler ();
You can’t perform that action at this time.
0 commit comments