# Issues with Web Browser Component (Kiosk mode + Memory leak)

**URL:** <https://forum.juce.com/t/issues-with-web-browser-component-kiosk-mode-memory-leak/14202>\
**Category:** Windows\
**Created:** [January 23, 2015, 5:17am UTC](https://forum.juce.com/t/issues-with-web-browser-component-kiosk-mode-memory-leak/14202 "2015-01-23T05:17:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oh3netid](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oh3netid/32/63_2.png) [@oh3netid](https://forum.juce.com/u/oh3netid)\
**Post date:** [January 23, 2015, 5:17am UTC](https://forum.juce.com/t/issues-with-web-browser-component-kiosk-mode-memory-leak/14202/1 "2015-01-23T05:17:18Z")

</div>

Two questions:

1-I seem to be leaking memory with just the following code change to a fresh GUI app.&nbsp;

```
MainContentComponent::MainContentComponent(){webBrowser = new WebBrowserComponent(false); addAndMakeVisible(webBrowser); setSize (600, 400);}
```

webBrowser is a ScopedPointer, btw.&nbsp;This gives me a memory leak when I close the app unless I comment out the addAndMakeVisible.

&nbsp;

2-When I try going into kiosk mode with the WebBrowserComponent added and made visible, I get a black screen. Here is what I tried. What am I doing wrong?

```
void initialise (const String& commandLine) override

    {

        // This method is where you should put your application's initialisation code..

        mainWindow = new MainWindow (getApplicationName()); Desktop::getInstance().setKioskModeComponent(mainWindow-\>getTopLevelComponent(), true); }
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 26, 2015, 12:18am UTC](https://forum.juce.com/t/issues-with-web-browser-component-kiosk-mode-memory-leak/14202/2 "2015-01-26T00:18:39Z")

</div>

What object is actually being leaked?

---

<div class="post-metadata">

**Author:** ![oh3netid](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oh3netid/32/63_2.png) [@oh3netid](https://forum.juce.com/u/oh3netid)\
**Post date:** [January 26, 2015, 5:24am UTC](https://forum.juce.com/t/issues-with-web-browser-component-kiosk-mode-memory-leak/14202/3 "2015-01-26T05:24:28Z")

</div>

I'm not really sure how to figure out what object(s) it's reporting on. Here is the output I'm seeing

```
JUCE v3.1.1

First-chance exception at 0x75352F71 (KernelBase.dll) in testapp.exe: 0x000006BA: The RPC server is unavailable.

Detected memory leaks!

Dumping objects ->

{381} normal block at 0x00A5E4F8, 12 bytes long.

 Data: < f > CC 66 C3 01 01 00 00 00 F0 02 08 00 

{380} normal block at 0x00A5E4A8, 16 bytes long.

 Data: < g > C8 67 C3 01 01 00 00 00 F0 02 08 00 F8 E4 A5 00 

{379} normal block at 0x00A52C58, 12 bytes long.

 Data: < h > 84 68 C3 01 01 00 00 00 A8 E4 A5 00 

Object dump complete.

The program '[680] testapp.exe' has exited with code 0 (0x0).
```

---

<div class="post-metadata">

**Author:** ![oh3netid](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oh3netid/32/63_2.png) [@oh3netid](https://forum.juce.com/u/oh3netid)\
**Post date:** [January 26, 2015, 6:08am UTC](https://forum.juce.com/t/issues-with-web-browser-component-kiosk-mode-memory-leak/14202/4 "2015-01-26T06:08:51Z")

</div>

Full screen issue resolved -

Taking a hint from&nbsp;http://www.juce.com/forum/topic/kiosk-mode-secondary-window, I disabled the native title bar (comment out setUsingNativeTitleBar) and now full screen with Web Browser Component works fine.

Now to figure out what's with the memory leak...

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 26, 2015, 4:28pm UTC](https://forum.juce.com/t/issues-with-web-browser-component-kiosk-mode-memory-leak/14202/5 "2015-01-26T16:28:32Z")

</div>

The memory leak looks like a false alarm to me. If it was a juce object then you'd get a dump from LeakedObjectDetector, so since it's just a handful of bytes, it's probably just some tiny bit of memory that the web browser itself is leaking.
