TGViewer
Telegram github commits and releases Telegram github commits and releases @tgappsupdates · 4.54K subscribers
Post #20634 77
UnigramDev/Unigram/emoji-drawer-detach • e7263f1 • 3 files, +37/-1
Detach the emoji and sticker drawers from their collections

InvalidComObjectException — "COM object that has been separated from its
underlying RCW cannot be used" — reported by crash telemetry on 12.9.1,
raised from MvxObservableCollection.ReplaceWith inside
EmojiDrawerViewModel.Update.

EmojiDrawer's CollectionViewSource and its two toolbars bind straight to the
view model's collections, so their native peers subscribe to CollectionChanged.
Deactivate() only called Bindings.StopTracking(), which stops the bindings from
updating but leaves the value they already pushed in place, and it runs right
before XamlMarkupHelper.UnloadObject destroys those peers. The view model
subscribes to the aggregator in its constructor and Handle queues Update on the
UI thread, so a queued update outlives the drawer and raises into the dead
peers.

Clear the collection sources in Deactivate so nothing native is still attached
once the peers go away. StickerDrawer has the same shape and the same terminal
Deactivate contract, so it gets the same treatment.

EmojiMenuFlyout never deactivated its drawer at all, and only one of its three
constructors subscribed to Popup.Closed; move that subscription into Initialize
and tear the drawer down there, matching what StickerPanel does when it unloads
a drawer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

#unigram
More from @tgappsupdates
  1. Oct 12, 2026TGX-Android/Telegram-X/main • a7ce680 • 2 files, +14/-3 Fix answering call from background…
  2. Oct 12, 2026TGX-Android/Telegram-X/main • 8d2d958 • 2 files, +9/-2 Fix answering call from background…
  3. Oct 12, 2026TGX-Android/Telegram-X/main • f4bdd29 • 1 files, +10/-3 Fix passing `aapt2` arguments #tgx…
  4. Oct 12, 2026TGX-Android/Telegram-X/main • 4e2dd7e • 1 files, +1/-1 Reduce APK size #tgxandroid
  5. Oct 12, 2026TGX-Android/Telegram-X/main • fd1f52d • 5 files, +16/-16 Remove rudimentary `this` referen…
  6. Oct 12, 2026TGX-Android/Telegram-X/main • 1128e91 • 3 files, +69/-0 Optimize APK size for `latest` fla…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →