Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6552303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:26:36+00:00 2026-05-25T12:26:36+00:00

I have a compiled external library that I’m using in my (Objective-C++) code. This

  • 0

I have a compiled external library that I’m using in my (Objective-C++) code. This library has a singleton class to store some information throughout the duration of the application being used. I really need a way to be able to remove the loaded information and reload it in the middle of the application. Or to reload the application so that this singleton is reinitialised.

In the header files there is no way to reset the class information.

The way I get an instance of it is:

Singleton::getInstance();

In the header file this is shown as:

static Singleton& getInstance();

I would like a way to be able to delete this instance and reinitialise another instance.

Is there any way to do this? This singleton is only being used on one (the main) thread.

Extra information

When the application first loads I have to call:

Singleton::getInstance().load();

so that it loads information from the Documents directory of the app and create an internal structure. I replace those files in the Documents directory in the middle of the application running and I want it to reinitialise. If I call the above function again I get an error because the person who wrote this library doesn’t allow the load function to be called twice.

I tried some stuff like:

delete &Singleton::getInstance();

but I don’t know how I should reinitialise it afterwards. As calling

Singleton::getInstance();

crashes the app.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:26:37+00:00Added an answer on May 25, 2026 at 12:26 pm

    Unless the API is providing you a way to do it, it’s probably impossible.

    But I would have try to rerun the “load” function after I call the delete…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class from an external library that I want to extend with
I have compiled a .NET application using Any CPU option. This .NET application uses
I have compiled the NTL inifite precision integer arithmetic library for c++, using Microsoft
I have an external library that takes an IntPtr. Is there any safe way
I have written a static library to re-use some code between iOS projects, let's
I have compiled a JNI library for Android with the NDK that statically links
I am in a big problem ..i have compiled my c files using linux
Under gcc (g++), I have compiled a static .a (call it some_static_lib.a ) library.
I created an application core, in C++, that I've compiled into a static library
I have a 3rd party library that's written in C. It exports all of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.