Skip to content

Moved aruco dictionary globals into getPredefinedDictionary to allow lazy-loading of the opencv DLL #2193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2019

Conversation

SoylentGraham
Copy link
Contributor

This pullrequest changes

I want to lazy-load my opencv dll, to which I've added the aruco module.

But as these objects are constructed globally the system crashes as I've not loaded the DLL yet.

Moving them into the only place they're used, constructed statically, they construct on first use, and only after I've loaded the DLL.

Having statics hidden in a function isn't the greatest of solutions, but then I wouldn't have made them globals anyway :)

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

Ptr<Dictionary> getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME name)
{
// DictionaryData constructors calls
// moved out of globals so construted on first use, which allows lazy-loading of opencv dll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabs => 4 spaces

@SoylentGraham SoylentGraham changed the base branch from master to 3.4 July 21, 2019 18:56
…ucted on first use, to allow lazy-loading of the opencv DLL
@opencv-pushbot opencv-pushbot merged commit 965421b into opencv:3.4 Aug 15, 2019
@alalek alalek mentioned this pull request Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants