C++ ~ App Destructor cause build error?

Hi all

I downloaded a code example:

https://github.com/BlackBerry/presentations/tree/master/2012-BlackBerryJam-Americas/JAM09/BaDumTss

You will notice in the files app.cpp and app.h, the following lines in bold.

App.cpp

SoundPartyApp::SoundPartyApp()
{

   // create the qml etc.

   mSoundManager = new SoundManager("sounds/");
}

SoundPartyApp::~SoundPartyApp()
{
  // Destroy the sound manager.
  delete mSoundManager;
}

App.h

class SoundPartyApp: public QObject
{
Q_OBJECT

public:

  // This is our constructor to setup our badumtss2 application
  SoundPartyApp();

  // This is our destructor that frees the memory of the sound manager
  ~SoundPartyApp();
  // more stuff here etc

private:
  // The sound manager
  SoundManager *mSoundManager;
};

I understand that this is with the old code, c ++. The new app.hpp which I use in Beta 3, so has a different 'virtual' destructor:

class SoundPartyApp : public QObject
{
Q_OBJECT

public:

    SoundPartyApp(bb::cascades::Application *app);
    virtual ~SoundPartyApp() {}

    // etc

}

The (new) ~ virtual SoundPartyApp() seems to conflict with the app.cpp function.

Do not know why.

I put comment function and now it works... but I guess now I'm not unallocating correctly the soundmanager of memory.

I can't seem to find useful discussions on how to get Beta 2 ~ beta3 destructive functions.

Any ideas?

If you want to move the main application code, just that:

virtual ~SoundPartyApp();

And then in the main application do all you need to do:

 SoundPartyApp::~SoundPartyApp() {    // do some important cleanup
    delete mSoundManager;
}

Tags: BlackBerry Developers

Similar Questions

  • Application Builder error

    Hello

    I use LV 8.6 and Application Builder. My Labview vi uses some third party vi to control a linear motor. The vi works well not respected. Can I complie an exe without errors, but when I run the exe, (on the same PC), I get the below error. (Connect.vi is the third party VI used to start communication with the motor). In this case with my vi and vi example of a third. I also have an exe from one of the vi from the engine supplier that works.

    On the error, I don't know why he mentioned NEITHER-488, I've never used (I don't think) so why it causes an error?

    Thank you

    Richard


  • chronic build error

    Since today, I get a build error in all of my projects:

    Error occurred during the build.

    Errors under builder "App descriptor Validator" of the project "MNKit".

    java.lang.NullPointerException

    Google gives no guidance on this. Restarting Momentics, or clean up projects does not help.

    At the opening of bar - descriptor.xml, I get:

    java.lang.NullPointerException
    to com.qnx.tools.bbt.core.signing.BarSignerTool. (BarSignerTool.java:105)
    to com.qnx.tools.ide.bbt.internal.core.BBTNativeSDKProvider$ BBTNativeSDKDescriptor.getBarSigner (BBTNativeSDKProvider.java:172)
    at com.qnx.tools.bbt.core.sdk.AbstractBlackBerryTabletSDKDescriptor.getValidator(AbstractBlackBerryTabletSDKDescriptor.java:122)
    at com.qnx.tools.ide.bbt.internal.core.BBTNativeSDKProvider.getValidSDKs(BBTNativeSDKProvider.java:97)
    to com.qnx.tools.bbt.core.sdk.IBlackBerryTabletSDKDescriptor$ IRegistry$ Impl.collectValidSDKs (IBlackBerryTabletSDKDescriptor.java:327)
    to com.qnx.tools.bbt.core.sdk.IBlackBerryTabletSDKDescriptor$ IRegistry$ Impl.getValidSDKs (IBlackBerryTabletSDKDescriptor.java:311)
    at com.qnx.tools.bbt.internal.core.utils.BlackberryTabletSDKUtils.getAvailableTargetPlatformVersions(BlackberryTabletSDKUtils.java:130)
    at com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.forms.GeneralAdvancedPart.getAvailablePlatformVersions(GeneralAdvancedPart.java:146)
    to com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.forms.GeneralAdvancedPart. (GeneralAdvancedPart.java:69)
    at com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.forms.GeneralPage.createLeftContent(GeneralPage.java:65)
    at com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.forms.GeneralPage.createFormContent(GeneralPage.java:54)
    at com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.forms.BBTFormPage.createFormContent(BBTFormPage.java:92)
    to org.eclipse.ui.forms.editor.FormPage$ 1.run(FormPage.java:152)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.forms.editor.FormPage.createPartControl(FormPage.java:150)
    at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:241)
    at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:325)
    at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:211)
    at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:308)
    at com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.BBTXMLEditor.addBBTPage(BBTXMLEditor.java:233)
    at com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.BBTXMLEditor.createGeneralPage(BBTXMLEditor.java:240)
    at com.qnx.tools.bbt.xml.internal.ui.editor.bbtxml.BBTXMLEditor.addPages(BBTXMLEditor.java:324)
    at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    to org.eclipse.ui.internal.WorkbenchPage.access$ 11 (WorkbenchPage.java:2842)
    to org.eclipse.ui.internal.WorkbenchPage$ 10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
    at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:99)
    at org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditorAction.java:99)
    at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
    to org.eclipse.ui.navigator.CommonNavigatorManager$ 3.open(CommonNavigatorManager.java:185)
    to org.eclipse.ui.OpenAndLinkWithEditorHelper$ InternalListener.open (OpenAndLinkWithEditorHelper.java:48)
    to org.eclipse.jface.viewers.StructuredViewer$ 2.run(StructuredViewer.java:866)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    to org.eclipse.ui.internal.JFaceUtil$ 1.run(JFaceUtil.java:49)

    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
    at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)
    to org.eclipse.jface.viewers.StructuredViewer$ 6.handleOpen(StructuredViewer.java:1256)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
    to org.eclipse.jface.util.OpenStrategy.access$ 2 (OpenStrategy.java:269)
    to org.eclipse.jface.util.OpenStrategy$ 1.handleEvent(OpenStrategy.java:309)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    to org.eclipse.ui.internal.Workbench.access$ 4 (Workbench.java:2499)
    to org.eclipse.ui.internal.Workbench$ 7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

    I am running on a Mac with the new Oracle Java 1.6.0.37 Mountain Lion.

    solved.

    Re-install Momentics and the simutaor is done.

  • Build error on request requestExit

    I encountered a strange problem to call the requestExit API. Compiles normal but generation has an error.

    undefined reference to the symbol "_ZN2bb11Application11requestExitEv".

    Note: '_ZN2bb11Application11requestExitEv' is defined in DSO C:/bbndk/target_10_0_9_2318/qnx6/armle-v7/usr/lib/libbb.so.1 try so add to the linker command line

    could not read symbols: invalid operation

    My source code is as below

    Cpp:
    
    MyApplication::MyApplication(bb::cascades::Application *app)
    : app(app)
    
    app->requestExit(); //Application::instance()->requestExit(); build error also
    
    bar-descriptor.xml
    
    
    .pro
    LIBS += -lbbsystem -lbbnetwork -lbbplatform -lscreen -lbbdata -lbbdevice
    

    Which library else I would add to my project?  Thanks for letting me out.

    Hello

    libbb.so East - lbb

  • An unexpected build error has occurred: index was outside the bounds of the array

    Hello

    I use OPA version 12.1.1 (November 2015 edition of cloud).

    When I try to debug my OPA project I get this error:

    "An unexpected build error has occurred: index was outside the bounds of the array.

    Does anyone of you understand what that means?

    Kind regards

    Xavier M.

    What language / region is your project?

    You are able to apply for service with the support of Oracle?  This error usually requires the investigation of the project to determine the root cause.

  • App is not installed. error 0x80072f78 code. Why?

    App is not installed. error 0x80072f78 code. Why?

    Hi, Giuseppe.

    Have you installed a third-party antivirus software?

    Error: 0x80072f78 is caused due to temporary connection related problems.

    Run the next fixit and check if the problem persists.

    http://support.Microsoft.com/kb/836941

    Note: run the computer without antivirus software or firewall is a potential threat to the computer; Be sure to activate security software after completing the troubleshooting steps and after identifying the problem.

    I hope this helps.

  • Build PhoneGap service "build error.

    I can't with Dreamweaver CC and PhoneGap Service of Build. I get "build error" and when I click on the button 'show' he says: "unable to download the application. (I build for Android only.) And build.phonegap.com my application name changed to 'PhoneGap Build Project' why? He had the good name before... And said the version 1.0.0 which is also wrong. The app ID is: 819335

    Hi Moki,

    Could you please download the zip file of the project on build.phonegap.com and build and tell me if you are faced with the same question.

    This could help solve your problem.

    Thank you

    Confidante

  • Oracle HRMS: APP-COMPENSATION-06153: System error

    Hello

    We work in version of oracle 11i applications.

    The HR user had the following error message when you try to enter an employee phone as phone numbers PERWSPHN ; of people-> enter and manage-> other-> phones


    APP-COMPENSATION-06153: System error: per_phn_shd.constraint_error of the procedure in step 5

    Cause: The per_phn_shd.constraint_error procedure has created a step 5 error

    Action: Contact your system administrator citing the procedure per_phn - shd.contraint_error in step 5.

    help please...

    Hmm, that's strange. This means that the PER_PHONES_PK wrong a primary key constraint (it's the slightest error in the package per_phn_shd constraint_error procedure).

    I don't know what could be wrong with that. The PER_PHONES_S sequence might have been rebuild or reset somehow?

    What it returns:

    SELECT max (phone_id)
    OF per_phones;

    And then what it returns:

    Select per_phones_s.nextval
    Double;

  • Build error cannot find the distribution under construction

    I had a similar problem like this thread.

    http://forums.NI.com/T5/LabVIEW/build-error-can-t-find-distribution-being-built/TD-p/1462842/page/2

    My old guard Installer and ask for copy of the installation is finish. Quite annoying because it takes so long to get there. Any advice would be appreciated. I've attached a screenshot of my error message.

    You created this problem by running a build already install on your development computer. If you are distributing drivers with your installer you should NEVER run the installation program on the machine on which you build.

    Here's what happens:

    All software shops NOR where it was installed since in the Windows registry. When you initially installed it note where you install (DVD, network drive, etc.).

    When you build an installer in TestStand will prompt for this location if it cannot find the original installation files (that is, if you take the DVD from the drive disconnected from the PC from the network, etc.)

    What happened on this PC is you have to build a Setup program, and then you run this installer on the PC, and because the pilots were already present it replaced the path stored in the registry with the path where your Installer (e.g.) was C:\Temp\long path)

    I'm guessing that you have now deleted this former Installer. That means that you have to re - run installers for ALL the software to, OR that you have installed on this machine so the registry is updated to point to the path of DVD or the network path.

  • Build error when you create the Provisioning package picture

    Hi all

    I'm trying to create a master Windows IOT image by using the tool of IDC (imaging and designer of Configuration).

    I created a package of commissioning and using"customization of the Windows Image" to create a kernel ITO image by specifying the configuration previously created package but still get a build error.

    It looks like a fairly simple process, but repeatedly gives the error below. Also, I have not all USB devices connected to the computer, nor are there insufficient memory problems.

    ERROR

    =====

    Progress of the staging: 75%
    Staging failed to: 75% complete
    UpdateDLL: Measurement of results:
    Staging of total time: seconds = 27 (tickcount = 27235)
    Error: imagery! UpdateImage: Failed call to UpdateDLL::PrepareUpdate with the error code:-2145877241 (0 x 80188307)
    DismountVirtualHardDiskByFileName: disassembly image C:\Users\Shridhar\AppData\Local\Temp\8eceab63e9b746c0a9c65848679d56eb.vhd
    DismountFullFlashImage: [0.219] cleanup of temporary access roads.
    CleanupTemporaryPaths: Cleaning of temporary path C:\Users\Shridhar\AppData\Local\Temp\IMG39F3.tmp\.
    Storage service: disassembly of the image in 0.2 seconds.
    Imaging: See Flash.cbs.log and Flash.csi.log for more details.
    Imaging: Performance results:
    Total running time: 00:00:52.7198674
    Time of image creation: 00:00:00.0642425
    Writing FFU Time: 00:00:00
    Battery storage time: 00:00:17.8667874

    Any help would be greatly appreciated.

    Hello

    Your question is beyond the scope of this community...

    Repost in the TechNet Forums:

    https://social.technet.Microsoft.com/forums/en-us/home

    Or MSDN Forums:

    https://social.msdn.Microsoft.com/forums/en-us/home

    See you soon.

  • How do I know what software is causing the error to Windows Installer: lack of program

    original title: How do I know what software is causing the error to Windows Installer

    Windows XP

    When you get this message that keeps popping up every two hours-

    The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded

    may be missing or the upgrade patch may update a different bersion of the program.   Make sure that the program

    to be upgraded exists on your computer and that you have the good patch upgrade. ."

    How do find you the application or software, or the program is causing the problem.  ?

    It is a simple solution.

    Go in run, type: msiexec /Unregister 'press the ok button.

    Back to run, enter: msiexec/regserver "press ok.

    Youre thru. Restart the pc

  • What is causing the error event ' BCM42RLY service failed to start due to the following error: the system cannot find the file specified "Event Id 7000

    What is causing the error event ' BCM42RLY service failed to start due to the following error: the system cannot find the file specified "Event Id 7000

    Hello

    1. Since when are you facing this problem?

    2. What is the number of brand and model of the computer?

    3. have you made changes on the computer recently?

    BCM42RLY is a Broadcom network card driver. I suggest that you uninstall and reinstall the drivers and check if it helps.
    Uninstall or reinstall a device: http://technet.microsoft.com/en-us/library/cc725782.aspx

    Hope the information is useful.

  • Explorer has caused an error in Kernel32.dll

    OK... I had recently installed Vista Ultimate Upgrade on an existing installation of the factory of Home Premium.  I don't know if this problem has occurred before the upgrade or not, as I have dual boot Vista and XP.  Understably, I tend to use XP ninety percent of the time.  Anyway, if I explore folders using Windows or Powerdesk File Explorer I get "Explorer has caused an error in Kernel32.dll" when the right click on ALL files.  Also, I get an error when you choose the "Device Manager" shortcut in the system window.  But I can open the Device Manager in the control panel list.  I did research to my heart's content.  For the life of me, I can't solve this question everything.  Help!  Please, I beg you. If need more info I adhere to me.  Thank you.

    Failing application explorer.exe, version 6.0.6001.18164, time stamp 0x4907e242, failed module kernel32.dll, version 6.0.6001.18000, time stamp 0x4791a76d, exception code 0xc0000005, offset 0x00048f47, process id 0 x 1168 error, start the application time 0x01c96c1e3f92be10.

    may be a problem of system files try this:

    Click on run in the start menu, if you have run here... try pressing Windows key + R and type SFC / SCANNOW (you will need to insert your windows cd/dvd in the drive) Microsoft Most Valuable Professional

  • Windows Live Photo Gallery causes the error Code: 0 x 80010108

    I have a desktop XPS 8500 running Windows 7.  Love it except for one thing: Windows Live Photo Gallery causes the error Code: 0 x 80010108.  Yes, I x it down and go ahead and use my computer but like it to stop.  I have google code and there are a number of fixes called there for him - even though they claim.  But I was reluctant to download anything on sites I don't necessarily trust OR conform to change my registry to fix it.  Can someone recommend a cure to my problem?  I have confidence in this forum for more than 12 years and feel that you will not recommend something that might get me in trouble.

    Thank you

    Bessie

    Hi Bessie,

    Thanks for the reply. I suggest you to uninstall Windows Live Essentials from the computer and update to the latest version. You can download it from the link http://bit.ly/GQ9tPI . Please disconnect all the external devices connected to the computer (printers, external hard drives, flash drives) and do not have any CD/DVD in the drive while following the steps.

    Answer please if you have any questions.

  • Upgrade 'Stacked vs. Non-Stack Build' error-

    During the upgrade from Vista to Win7, I am stopped by an "stacked vs. non-Stack build" Error Message... which means this message - means and how to successfully upgrade to Win7?

    For all questions, installation of Windows 7, the Windows 7 Forums are the best place to ask, as they came across these errors before:

    http://social.answers.Microsoft.com/forums/en-us/w7install/threads

    "Download Windows 7 installed and activated on your PC."

    They will help you in the Windows 7 Forum at the above address.

    See you soon. Mick Murphy - Microsoft partner

Maybe you are looking for