Cysharp / Cysharp/ObservableCollections

Clear method prevents collections of IDisposable items.

Open
#99 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1k
Forks
73
Avg merge
5d 4h
Merged PRs (30d)
2

Description

Currently, when using an ObservableCollection to store items which implement IDisposable, it is impossible to observe the collection to ensure item disposal. If the 'Clear' method is called, there is no way for an observer to get a reference to the items previously in the list in order to dispose them. Ideally, when clear is called, the list of old items should be available.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the ObservableCollection Clear entry point and its observer notification path, then inspect how collection changes are currently exposed. Done means an observer can access the items removed by Clear, allowing IDisposable items to be disposed reliably; verify the behavior with the existing collection tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.