Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#17394 closed defect (fixed)

dijit.form._FormSelectWidget does not clean up observer when using Observable stores

Reported by: haysmark Owned by: haysmark
Priority: high Milestone: 1.8.6
Component: Dijit - Form Version: 1.8.5
Keywords: Cc:
Blocked By: Blocking:

Description

_FormSelectWidget checks to see if the store being passed in setStore() is observable (i.e. has the observe method), and if so, it observes it for updates to the select options. However, it never cleans up the handle returned by the observe() method. So when you destroy the select widget, the observation continues, and of course, errors out trying to update a select list of options that no longer exist.

It seems like the writer expected the query results object returned from the store, to contain a special close method, and that this would take care of all clean up with regards to the store. You can see they check for _queryRes.close to do this. But, e.g., Memory Stores at least, don't produce query result objects that have this close method, and neither does Observable. I'm not sure which kind of QueryResult/Store? combination they were expecting provided this close method, and whether they though it would also clean observing handles. Nevertheless, this close method is never found so it's not used, and the observing handle never gets cleaned up on destroy.

Refer to dijit/form/_FormSelectWidget#setStore.

Attachments (1)

test_Select.html (48.6 KB) - added by haysmark 6 years ago.
Test case modified to destroy second widget with same store.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by haysmark

Attachment: test_Select.html added

Test case modified to destroy second widget with same store.

comment:1 Changed 6 years ago by haysmark

Owner: set to haysmark
Status: newassigned

comment:2 Changed 6 years ago by haysmark

Milestone: tbd1.8.6
Version: 1.9.11.8.5

comment:3 Changed 6 years ago by haysmark

Priority: undecidedhigh

comment:4 Changed 6 years ago by mahays0 <mahays0@…>

Resolution: fixed
Status: assignedclosed

In bda7e1d7a804b4fd640ef91ae3cbdf94afb49336/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 6 years ago by mahays0 <mahays0@…>

In 23fa5e40a33ce21046c2c494f125c4a445cfa08d/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 6 years ago by mahays0 <mahays0@…>

In 396f758b8abe3c81b9612502cb2dc41049a49b56/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.