Strange assert in Component, "bad idea to try to resize a window during its paint()"

#1

This is happening even though I am not calling it from paint(). I am calling resize() on my component in response to a ValueTree::valueTreeChildRemoved callback. Is it because I am removing the child in a mouseDown? Any ideas?
Call stack:

|>|Live Controller.exe!juce::Component::setBounds(int x, int y, int w, int h) Line 1078|C++|
|---|---|---|
| |Live Controller.exe!MacroListComponent::resized() Line 79|C++|
| |Live Controller.exe!MacroListComponent::valueTreeChildRemoved(juce::ValueTree & parentTree, juce::ValueTree & childWhichHasBeenRemoved, int __formal) Line 97|C++|
| |Live Controller.exe!juce::ValueTree::SharedObject::sendChildRemovedMessage::__l2::<lambda>(juce::ValueTree::Listener & l) Line 113|C++|
| |Live Controller.exe!juce::ListenerList<juce::ValueTree::Listener,juce::Array<juce::ValueTree::Listener *,juce::DummyCriticalSection,0> >::callExcluding<void <lambda>(juce::ValueTree::Listener &) &>(juce::ValueTree::Listener * listenerToExclude, juce::ValueTree::SharedObject::sendChildRemovedMessage::__l2::void <lambda>(juce::ValueTree::Listener &) & callback) Line 141|C++|
| |Live Controller.exe!juce::ValueTree::SharedObject::callListeners<void <lambda>(juce::ValueTree::Listener &) >(juce::ValueTree::Listener * listenerToExclude, juce::ValueTree::SharedObject::sendChildRemovedMessage::__l2::void <lambda>(juce::ValueTree::Listener &) fn) Line 87|C++|
| |Live Controller.exe!juce::ValueTree::SharedObject::callListenersForAllParents<void <lambda>(juce::ValueTree::Listener &) >(juce::ValueTree::Listener * listenerToExclude, juce::ValueTree::SharedObject::sendChildRemovedMessage::__l2::void <lambda>(juce::ValueTree::Listener &) fn) Line 95|C++|
| |Live Controller.exe!juce::ValueTree::SharedObject::sendChildRemovedMessage(juce::ValueTree child, int index) Line 113|C++|
| |Live Controller.exe!juce::ValueTree::SharedObject::removeChild(int childIndex, juce::UndoManager * undoManager) Line 298|C++|
| |Live Controller.exe!juce::ValueTree::removeChild(const juce::ValueTree & child, juce::UndoManager * undoManager) Line 936|C++|
| |Live Controller.exe!MacroComponent::mouseDown::__l5::<lambda>(int menuId) Line 60|C++|
| |[External Code]||
| |Live Controller.exe!juce::LambdaCallback::modalStateFinished(int result) Line 287|C++|
| |Live Controller.exe!juce::ModalComponentManager::handleAsyncUpdate() Line 201|C++|
| |Live Controller.exe!juce::AsyncUpdater::AsyncUpdaterMessage::messageCallback() Line 35|C++|
| |Live Controller.exe!juce::WindowsMessageHelpers::dispatchMessageFromLParam(__int64 lParam) Line 57|C++|
| |Live Controller.exe!juce::MessageManager::dispatchNextMessageOnSystemQueue(bool returnIfNoPendingMessages) Line 143|C++|
| |Live Controller.exe!juce::MessageManager::runDispatchLoop() Line 128|C++|
| |Live Controller.exe!juce::JUCEApplicationBase::main() Line 266|C++|
| |Live Controller.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 155|C++|
0 Likes

#3

My bad… It was because the Component I was calling setBounds on had been deleted. Stupid code tricks…

0 Likes