Bug 307270 - API: AccessibilityObject::actions() returns raw pointers
Summary: API: AccessibilityObject::actions() returns raw pointers
Status: CONFIRMED
Alias: None
Product: qaccessibilityclient
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 0.3.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Frederik Gladhorn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-23 15:02 UTC by Peter Grasch
Modified: 2018-11-20 09:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Grasch 2012-09-23 15:02:52 UTC
The actions() method of AccessibilityObject returns raw pointers to QAction objects that are deleted in its destructor.

A calling application has no way to ensure that the pointers are still valid before calling trigger().

Reproducible: Always
Comment 1 Frederik Gladhorn 2012-09-23 21:27:59 UTC
Sebastian, it would be great if we could discuss this api and maybe come up with some improvements.
Comment 2 Sebastian Sauer 2012-09-24 16:32:45 UTC
The different concepts we could follow:

1. Shared ownership.

That could for example means that we return a QVector< QSharedPointer<QAction> > but that means users still need to make sure to keep in there application to keep a the ref-counter and prevent freeing. Note that this is not different from how it works now cause you can just keep a AccessibleObject in your app and then the actions will keep on to live as long as the AccessibleObject does.

2. Caller-responsibility.
We just always pass responsibility to delete the actions to the caller. I think this is rather error-prune through at the end it may the most clean way forward.

Problem of invalid-notifications
I think it makes absolute sense if our lib keeps a list of the actions it passed out (as in a kind of "cache") cause that way we could easily automate/handle the case that the object the actions points to is invalidated (e.g. marked defunct). What we really like here is a way to inform the caller (means the app) that the action is not valid any longer so the application can react like for example setEnabled(false) the actions or just remove/delete them.
Comment 3 Andrew Crouthamel 2018-11-09 01:04:15 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Andrew Crouthamel 2018-11-20 03:57:28 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!