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 7846893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:44:39+00:00 2026-06-02T17:44:39+00:00

see i have mainActivity which calls tempActivity Now inside tempActivity i call some native

  • 0

see

i have mainActivity which calls tempActivity

Now inside tempActivity i call some native method and malloc some data .. so now when user

1> come back from tempActivity to mainActivity or

2> exit from whole application

i need to call one clean up function which free all data malloc in native method so how can i implement such things?

Does android framework has any method to handle such clean up function?

  • 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-06-02T17:44:42+00:00Added an answer on June 2, 2026 at 5:44 pm

    Ok, i think the question is about how to free the memory that is being allocated using malloc() inside native code.

    I had the same requirement in one of my Projects. I did it in the following way.

    Inside onStop() or onDestroy(), I did a native call, which I have used to free() the allocated memory. This I think is the best and simplest way to do that. I am not sure if android is providing some API,s for this. It would be informatory to know if something like this exists. Thanks.

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

Sidebar

Related Questions

I have a method call isNetworkAvailable() to check if the user have enable wap/wifi/wimax
I see an application have used Log.info = some info where are these logs
I have method which return the latitude of the location public double[] getlat(){ double
I am trying to insert some data into a table I created. I have
I have a mainActivity which is Customer.java with listview of 5 diff. activities. I
I have an application which upon start request around 10-12KB of data from server
i see they have a version of resharper for vs 2010 http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+5.0+Nightly+Builds can i
Sometimes I see and have used the following variation for a fast divide in
I have this: As you can see I currently have a conditional to include
Is there a way to see users that have certain security role assigned? I'm

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.