WebThingsIO / webthing-arduino

Simple server for ESP8266, ESP32, Ethernet, or WiFi101-compatible boards compliant with Mozilla's proposed WoT API
Mozilla Public License 2.0
207 stars 78 forks source link

Memory full because of actions #121

Open LasseRosenow opened 4 years ago

LasseRosenow commented 4 years ago

When I have an Action, I have to create a new ThingActionObject on every call like this:

ThingActionObject* up_action_generator(DynamicJsonDocument *input) {
  return new ThingActionObject("up", input, do_up, nullptr);
}

But after too many calls my memory will be full and my device crashes.

mrstegeman commented 4 years ago

This is actually an issue with all of the webthing libraries. The spec doesn’t indicate if and when old actions should be dropped.