Opened 2 years ago

Closed 11 months ago

Last modified 11 months ago

#14616 closed defect (fixed)

Fix wxDataViewCtrl crashing after calling AssociateModel(NULL)

Reported by: troelsk Owned by:
Priority: low Milestone:
Component: wxGTK Version: stable-latest
Keywords: wxDataViewCtrl needs-work Cc:
Blocked By: Blocking:
Patch: no

Description

That is, you want to disassociate the model while still displaying the window. This makes it crash currently.
Patch tested on MSW only.

Attachments (2)

datavgen.txt download (164 bytes) - added by troelsk 2 years ago.
Trunk
datavgen.patch download (1.1 KB) - added by troelsk 2 years ago.
Trunk

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by troelsk

Trunk

Changed 2 years ago by troelsk

Trunk

comment:1 Changed 2 years ago by vadz

  • Keywords needs-work added
  • Priority changed from normal to low
  • Status changed from new to confirmed

Does it really make sense to set a new model for the control? Looking at the code, the native wxGTK version would crash too if you tried to do it. OTOH wxOSX one does have checks for model != NULL so apparently this is supposed to work... OT3H the documentation doesn't mention anything about this possibility.

Is it really useful in practice? If so, we should fix wxGTK version too and explicitly mention that it's possible in the documentation.

comment:2 Changed 2 years ago by troelsk

Useful yes. In my unsophisticated app I display a dataview list, with a Open button next to it, and a Close button. The list is empty until the user selects a file (with the Open button), and it goes empty again when the user clicks close. Hence model = NULL.

comment:3 Changed 2 years ago by vadz

  • Component changed from GUI-generic to wxGTK
  • Patch unset

OK, I'll apply the patch but will keep the ticket opened because we still need to fix it for the native GTK version too then.

comment:4 Changed 2 years ago by VZ

(In [72590]) Don't crash in generic wxDataViewCtrl if it doesn't have any model.

A model may be dissociated from a still existing control, don't crash if it
happens (notice that we still would crash in the native GTK version right now,
so this still remains to be fixed there).

See #14616.

comment:5 Changed 11 months ago by VS

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [75272]) Allow NULL model in wxGTK's wxDataViewCtrl.

This is consistent with other ports.

Fixes #14616.

comment:6 Changed 11 months ago by VS

(In [75274]) Allow NULL model in wxGTK's wxDataViewCtrl.

This is consistent with other ports.

Fixes #14616.

Note: See TracTickets for help on using tickets.